USB alternative for LPRINT command in GWBASIC

January 8, 2011 at 14:13:25
Specs: Windows XP
I can't no longer use LPRINT command in GWBASIC since my printer is USB. I need the command(s) to operate via USB port. Does the command exist or do I need a call command, or other trick to do it.
I have Windows XT and my old programs work fine except for the printing....
Tnx for any ideas.

See More: USB alternative for LPRINT command in GWBASIC

Report •

January 8, 2011 at 14:39:22
1) Share your printer and assign a shared name as e.g. USBPrint
2) At prompt type

net use LPT1 \\%computername%\USBPrint /persistent:YES

Now your LPRINT command is redirected to the local USB printer. If the directive is not retained between boots make a one line batch with the command and store into the Startup Folder.

Report •

January 8, 2011 at 14:56:43
Thank you for the input. However, what mode I need to be to have the commands work? Is it in the middle of a basic program?
I;ll like to replace the PRINT statement to another that prints directly to the printer rather than directing to a text file and then printing it.
Also, I'll like to see the LIST command printed on a printer vs the screen.
Any help?

Report •

January 9, 2011 at 03:09:36
The net use command is a Windows XP command not a BASIC statement. It redirects the LPT1 or PRN port to the USB local printer previously shared and acts on the whole operating system environment.

To share the local printer click START/Settings\Printers, select the printer, right click choosing Properties then click the Share sheet and select share giving a shared name (in my example USBPrint).

Open Notepad and type the following

@net use LPT1 \\%computername%\USBPrint /persistent:YES

Save as USBPrint.bat and copy/paste the saved file into the Startup Folder

\Documents and Settings\All Users\Start Menu\Programs\Startup Folder

Then reboot and you are done.

About to redirect the LIST command to a printer when starting your program from the prompt type after the program name > PRN (e.g. MyProg > PRN).
Be aware all screen output will be redirected to the printer.

Report •

Related Solutions

Ask Question