Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
USB Printer problems
#1
I cannot get an Epson Stylus S22 USB printer to printout using the usual LPRINT with QB. I expect other USB printers do not work now with QB

Any suggestions please. The printer works OK with other Basics etc.
Reply
#2
You can assign the LPRINT text output to the default USB printer.


Code:
CLS
COLOR 11: LOCATE 2, 20: PRINT "XP or NT USB Printer to assign for LPRINT"
COLOR 10: LOCATE 3, 4: PRINT "In Control Panel, set the USB printer to Share with Text Format (not RAW)."

Computer$ = ENVIRON$("COMPUTERNAME")

IF LEN(Computer$) = 0 THEN
         SHELL "NET VIEW"
         COLOR 14: INPUT "               Enter your NT Computer Name: ", Computer$
END IF

IF LEN(Computer$) THEN
   SHELL "NET VIEW " + Computer$: COLOR 10: PRINT "    Computer Name = "; Computer$
ELSE : COLOR 12: PRINT "          Program cannot Continue!": SLEEP 4: SYSTEM
END IF

COLOR 14: INPUT "        Enter the USB Printer's Share Name from above: ", Printer$

PRINT
IF LEN(Printer$) THEN
   SHELL "NET USE LPT1 \\" + Computer$ + "\" + Printer$
ELSE : COLOR 12: PRINT "         No Entry, Program Aborted! ": SLEEP 4: SYSTEM
END IF

PRINT
COLOR 10: PRINT "              Testing your Printer!"
LPRINT "Test of USB Printer use with LPRINT in NT!" + CHR$(10) 'linefeed
LPRINT CHR$(12) 'formfeed

COLOR 14: PRINT "           Did the Printer work correctly? (Y/N) ";
DO: work$ = UCASE$(INKEY$): LOOP UNTIL work$ = "Y" OR work$ = "N"
COLOR 11: PRINT work$

PRINT
IF work$ = "Y" THEN
   OPEN "NOLPRINT.BAT" FOR OUTPUT AS #4
      PRINT #4, "ECHO Removing LPT to USB printer Network!"
      PRINT #4, "NET USE LPT1 \\" + Computer$ + "\" + Printer$ + " /delete"
      PRINT #4, "PAUSE"
   CLOSE #4
   COLOR 10: PRINT : PRINT "NOLPRINT.BAT created! Use BAT file to cancel sharing."
ELSE :
   SHELL "NET USE LPT1 \\" + Computer$ + "\" + Printer$ + " /delete"
   COLOR 12: PRINT " Sorry! Did not setup printer! Check your printer settings. "
END IF

SYSTEM

See Chapter 11, Part 7 of my Qbasic tutorial to set up the Print Processor: http://bit.ly/MXFkTM

You need to enable printer sharing on your network(a single PC has its own network) and run the program above. Set the Print Processor up for TEXT, not LEMF or RAW.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)