Annoyances.org
Home » Windows XP Discussion Forum » Message 1211070592 Search | Help | Home
  
Command Line Print Command - Help Mapping a Networked Printer to LPT1
Saturday, May 17, 2008 at 5:29 pm
Windows XP Annoyances Discussion Forum
Posted by Moon Raker (1 messages posted)


1.) Download the kix32.com
     kixtart scripting command

http://www.kixtart.org/downloads/

3.) Copy and Paste the following into notepad save as
     print.bat

  $Printer = 

READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows 

NT\CurrentVersion\Windows","Device");

   $Index = 1

   WHILE $Index < LEN($Printer)

   $Testchar = SUBSTR($Printer, $Index, 1)
   IF $Testchar = ','
           $Cutat = $Index - 1
           $Index = LEN($Printer)
   ENDIF

   $Index = $Index + 1

   LOOP

   $Printer = SUBSTR($Printer, 1, $Cutat)
   $Checklocal = SUBSTR($Printer, 1, 2)

   ? "Default Printer: $Printer"

   ; only map if Default Printer is Network Printer
   IF $Checklocal = "\\"
           ? "Removing existing LPT1 mapping ..."
           USE LPT1 /D
           USE LPT1 $Printer
                   IF @ERROR
                           BEEP
                           ? "Error @ERROR mapping 

$Printer to LPT1"
                   ELSE
                           ? "Done. $Printer mapped to 

LPT1"
                   ENDIF
   ELSE
           ? "ABORT. Default Printer is not a network 

printer!"
   ENDIF


4.) run the command
kix32.exe print.bat

This will look for a networked printer and map it to LPT1.
Now you can use the dos command print.

example:
print print.bat  or print filename




Responses to this message:
*re: Command Line Print Command - Help Mapping a Networked Printer to LPT1 (normanw: Monday, May 19, 2008 at 2:59 am)

All messages in this thread [show all]
-Command Line Print Command - Help Mapping a Networked Printer to LPT1 (Moon Raker: Sat, May 17, 2008, 5:29 pm)
*re: Command Line Print Command - Help Mapping a Networked Printer to LPT1 (normanw: Mon, May 19, 2008, 2:59 am)
Return to the Windows XP Discussion Forum

All content at Annoyances.org is Copyright © 1995-2008 Creative Elementtm All rights reserved.
Please do not plagiarize; redistributing these pages without permission is strictly prohibited.