|
Answer» echo off cls echo Add Printer \\%2\%3 on %1 echo _______________________________________ _____ echo.
if {%1}=={} GOTO HowTo if {%2}=={} goto HowTo
CALL >>\\%1\c$\temp\printer.vbs ECHO '------------------------------------------- >>\\%1\c$\temp\printer.vbs ECHO ' Printer Install for network printer: >>\\%1\c$\temp\printer.vbs ECHO ' %2 >>\\%1\c$\temp\printer.vbs ECHO '------------------------------------------- >>\\%1\c$\temp\printer.vbs ECHO Dim net >>\\%1\c$\temp\printer.vbs ECHO Set net = CreateObject("WScript.Network") >>\\%1\c$\temp\printer.vbs ECHO net.AddWindowsPrinterConnection "%2" >>\\%1\c$\temp\printer.vbs ECHO '-------------------------------------------
psexec -i -d -s \\%1 printer.vbs
echo Printer %2 has been successfully added on %1.
Goto End
:HowTo echo Adds a printer on the target workstation echo. echo Usage: Printer [COMPUTERNAME] [\\Server\Printer] echo.
:End pauseI am trying to launch a file that is created with my .CMD file but pcexec says it cannot find the specified file:- I need this file to open on the remote system and not on mine.
Here is the code for my .cmd file:- ------------------------------------------------------------------------
Can ANYBODY TELL me how to launch the printer.vbs file so that it opens on a remote workstation and not on mine???
Info>http://web.mit.edu/pismere/admin/nt4remot.htm
|