yellowartist
IS-IT--Management
I am wanting to create a script or a batch file that I can post on a intranet site that I can direct users to for printer installs.
We like to have the printer installed as a local printer, with a tcp/ip port (this resolves both by the IP address or the name of the printer). Here is the code I have wrote
Everytime I run it I get the following error:
The box says "Printers"
Error Msg: "The arguments are invalid"
I have tried this on multiple computers.
Verified the path of the inf files and made sure I had access to it with the credentials I was logged on with.
Made sure I could ping the printer both by name or ip. I also just tried it with a batch file as follows.
Any help is appreciated.
Thanks.
We like to have the printer installed as a local printer, with a tcp/ip port (this resolves both by the IP address or the name of the printer). Here is the code I have wrote
Code:
StrPrinterName = ("WCP3516_PS")
StrPrintinfloc = "\\Server\installs\drivers\Printer\Xerox\Xerox_Work_Center\Pro_35_45_55\WXP\ps\Xrw55ps.inf"
StrTCPIP = "xxx.xxx.xxx.xxx"
StrPortName = ("WCP3516")
set objShell = CreateObject("Wscript.Shell")
'Installs Printer
Objshell.Run "%comspec% /c " & "rundll32 printui.dll,PrintUIEntry /if /b" & StrPrinterName & " /f" & StrPrinterinflocation & " /r" & StrPortName & " /m" & StrPrintinfloc & ",,True"
Everytime I run it I get the following error:
The box says "Printers"
Error Msg: "The arguments are invalid"
I have tried this on multiple computers.
Verified the path of the inf files and made sure I had access to it with the credentials I was logged on with.
Made sure I could ping the printer both by name or ip. I also just tried it with a batch file as follows.
Code:
rundll32 printui.dll,PrintUIEntry /if /b "WCP3516" /f
\\server\share\inf\ntprint.inf /r "IP_xxx.xxx.xxx.xxx" /m "printer driver"
Any help is appreciated.
Thanks.