/build/static/layout/Breadcrumb_cap_w.png

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

0 Comments   [ + ] Show comments

Answers (1)

Posted by: anonymous_9363 16 years ago
Red Belt
0
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ