Script help needed
Hi Everyone,
I am new to vb scripting...and i need a script that does the following tasks..
1)Prompt Admin to enter the printer path in the form \\PrintServer\Printer
2)Run the command printui.dll,PrintUIEntry /ga /c\\machine /n\\PrintServer\Printer /j"LanMan PrintServices"
I have made a script but its throwing error on running. Please help me ..
Servername=InputBox("Enter the Servername and the printer name in this format \\PrintServer\Printer")
Set objShell = Wscript.CreateObject("Wscript.Shell")
objshell.run ("%comspec% rundll32""printui.dll""PrintUIEntry""/ga""Servername""/j"""LanMan PrintServices""),1,True
I am new to vb scripting...and i need a script that does the following tasks..
1)Prompt Admin to enter the printer path in the form \\PrintServer\Printer
2)Run the command printui.dll,PrintUIEntry /ga /c\\machine /n\\PrintServer\Printer /j"LanMan PrintServices"
I have made a script but its throwing error on running. Please help me ..
Servername=InputBox("Enter the Servername and the printer name in this format \\PrintServer\Printer")
Set objShell = Wscript.CreateObject("Wscript.Shell")
objshell.run ("%comspec% rundll32""printui.dll""PrintUIEntry""/ga""Servername""/j"""LanMan PrintServices""),1,True
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
anonymous_9363
17 years ago
Bit late in the day, but for anyone wandering in here in the future...
The original simply suffered from an over-abundance of quote marks. Also, the use of COMSPEC was unnecessary:
Servername =InputBox("Enter the server name and the printer name in this format: \\PrintServer\Printer")
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run("rundll32 printui.dll PrintUIEntry /ga" & Servername & "/j LanMan PrintServices"),1,True
The original simply suffered from an over-abundance of quote marks. Also, the use of COMSPEC was unnecessary:
Servername =InputBox("Enter the server name and the printer name in this format: \\PrintServer\Printer")
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.Run("rundll32 printui.dll PrintUIEntry /ga" & Servername & "/j LanMan PrintServices"),1,True
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.