Annoyances.org
Home » Windows XP Discussion Forum » Message 1211070592 » Entire Thread Search | Help | Home
  
Command Line Print Command - Help Mapping a Networked Printer to LPT1
Showing all messages in thread #1211070592
Windows XP Annoyances Discussion Forum


The following are all of the messages in this thread (2 in all), shown in chronological order. Click any message subject to view that message by itself or to view the thread hierarchy.
Command Line Print Command - Help Mapping a Networked Printer to LPT1
Saturday, May 17, 2008 at 5:29 pm
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

[Reply or follow-up to this message]

re: Command Line Print Command - Help Mapping a Networked Printer to LPT1
Monday, May 19, 2008 at 2:59 am
Posted by normanw (866 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

[Reply or follow-up to this message]

Tip: Use one of the [Reply or follow-up to this message] links above to add a message to this thread
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.