INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Hello Everyone in this forum, I am

Hello Everyone in this forum, I am

(OP)
Hello Everyone in this forum,
I am using fox pro 2.6 DOS based program, can anybody tell me how to send my file to laser printer without going in windows. Right now I am using following commonds to send print to dot matrix printer.
Set print on
set device to print
set print to mfile
after process
run type &mfile >prn

Please tell me how to print my above file (mfile) in laser printer

RE: Hello Everyone in this forum, I am

Are you using a Report Form?

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Hello Everyone in this forum, I am

FoxPro 2.6 Dos prints directly to parallel port. Does your laser printer have a parallel port? If so, I think your code would work to print.

Betting that it only has a usb port which means you will have to install the printer in windows, then share the printer.
From dos command type in the following:
net use lpt1 "\\computer name\share name you gave printer" /persistent:yes

After you get that to work manually, what I do is use a .bat file to take care of the mapping at startup. Here is the batch file code I use:
Foxmenu.bat is the name I use for the file.

*foxmenu.bat
@ECHO OFF
rem next line deletes previous mapping of lpt1 port
net use lpt1 /delete

rem how to use usb shared printer
rem printer must already be setup through windows and shared first
rem this will redirect the printer output from lpt1 which foxpro always uses
rem to the shared usb printer
rem this batch file must be edited for each computer that has
rem a usb printer connected to it. Put the edited batch file on the server
rem and create a shortcut to it on the the desktop of the computer using
rem the usb printer.
rem example net use lpt1:\\john\brotherh /persistent:yes

rem If there are any spaces in the printer's name, you must put quotation marks around the computer name and printer name
rem type net use lpt1 "\\computer name\share name you gave printer" /persistent:yes

rem note \\ before computer name and space after printer name
rem edit the next lines as needed and remove the rem so it will be executed
rem net use lpt1: \\computer name\shared printer name /persistent:yes
IF ERRORLEVEL 2 GOTO FAIL
IF ERRORLEVEL 4 GOTO FAIL
IF ERRORLEVEL 5 GOTO FAIL
rem the above error lines will cause the batch file to error if it cannot map
rem map the lpt1 port to the printer...
net use lpt1 "\\CWF002\Blinds Dell Laser 1710" /persistent:yes
echo.
echo.
echo.
echo.
echo IMPORTANT!!!!!! IMPORTANT!!!!!
echo.
echo If it does not say the commands completed successfully
echo.
echo Hit Ctrl C and then Y to terminate the program
PAUSE
rem the next line starts fox and calls the menu program
fox menu

goto end

:Fail
cls
echo.
echo. An error occured
pause
goto :end

:end
exit

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close