LPT redirection in W2K TS

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
 
D

Dan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top