LPT redirection in W2K TS

  • Thread starter Thread starter Fran Varona
  • Start date Start date
F

Fran Varona

Hello from Spain.

I found in this newsgroup a script (I think from Claudio) to redirect LPT
port in a TS client session. This is the script:

rem get the session ID out of the %TEMP% environment variable
for /f "eol=; tokens=6 delims=\ " %%i in ("%TEMP%") do set TSSID=%%i
rem construct the printer name
set TSPrinterName=PrinterName/%CLIENTNAME%/Session %TSSID%
rem share the printer
rundll32 printui.dll,PrintUIEntry /Xs /n "%TSPrinterName%" sharename
"TSPrinter%TSSID%" attributes +Shared
net use lpt1: /DELETE
net use lpt1: \\127.0.0.1\TSPrinter%TSSID%

Now, I try to use it and I get an error with the "rundll32" line. Can anyone
tell me what is the problem, or a different solution?

Thanks in advance,

Fran Varona
 
Check out KB article 264039 - you can do it with the net
use command.

Hope this helps...
-----Original Message-----
Hello from Spain.

I found in this newsgroup a script (I think from Claudio) to redirect LPT
port in a TS client session. This is the script:

rem get the session ID out of the %TEMP% environment variable
for /f "eol=; tokens=6 delims=\ " %%i in ("%TEMP%") do set TSSID=%%i
rem construct the printer name
set TSPrinterName=PrinterName/%CLIENTNAME%/Session %TSSID%
rem share the printer
rundll32 printui.dll,PrintUIEntry /Xs /n "% TSPrinterName%" sharename
"TSPrinter%TSSID%" attributes +Shared
net use lpt1: /DELETE
net use lpt1: \\127.0.0.1\TSPrinter%TSSID%

Now, I try to use it and I get an error with
the "rundll32" line. Can anyone
 
Back
Top