Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello Everyone in this forum, I am

Status
Not open for further replies.

Vinod Pandey

Programmer
Jun 29, 2017
1
0
0
IN
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
 
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]
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top