re: Command Line Print Command - Help Mapping a Networked Printer to LPT1
Monday, May 19, 2008 at 2:59 am Windows XP Annoyances Discussion Forum
Posted by normanw
(868 messages posted)
You should have posted this in the original thread opened by the
person who asked for the information.
On Saturday, May 17, 2008 at 5:29 pm, Moon Raker wrote:
>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
|