Solved

vbscript to sliently install printer driver with rundll32.exe

Posted on 2011-02-23
7
658 Views
Last Modified: 2012-05-11
Hello All,

I have an up and running script that will create a tcp/IP port and also the printer driver and queue.

when creating the printer queue and driver, it copies the driver from the network down locally.  So, the users will see a brief copy window.

Anyway of doing this so the user doesn't see this copy window?  The "/q" does not work.  It's quiet all right but doesn't install the driver.

Here is the string I'm using:

rundll32 printui.dll,PrintUIEntry /if /b PrinterName/f  PathToInfFile  /r IP_Port IPaddress /m PrinterModel

0
Comment
Question by:birddog2008
  • 3
  • 2
  • 2
7 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 34966455
Does it help if you use:
Set objShell = CreateObject("WScript.Shell")
objShell.Run "cmd /c rundll32 printui.dll,PrintUIEntry /if /b PrinterName/f  PathToInfFile  /r IP_Port IPaddress /m PrinterModel", 0, True

Regards,

Rob.
0
 
LVL 13

Expert Comment

by:connectex
ID: 34966669
This doucment from Microsoft covered printui.dll and it's various options: http://download.microsoft.com/download/8/2/c/82cffcfa-56f6-4fc3-bfa5-80cd84793871/PrintUIUsersGuide.doc. There is a switch /q for quiet. So it's not really necessary to use VBScript to do this.
0
 
LVL 13

Expert Comment

by:connectex
ID: 34966678
Ok. I missed the /q note in the inital question. Sorry about that.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:birddog2008
ID: 34971479
Np Connectex...ya too bad that doesn't work.  It works if the driver is local...so if you used /q /u...works actually brilliantly...but for me all the drivers will be on the net for most all users the first few times.

Hi Rob - No...that doesn't work either...it is exactly the same result weather you use cmd /c or not.  That's the other problem.

Any other ideas?

Thanks!
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34976823
Have you tried the /Gw switch?  This is supposed to suppress any driver warnings.

Other than that, I don't really see a way to hide the file copy process.....

Regards,

Rob.
0
 

Accepted Solution

by:
birddog2008 earned 0 total points
ID: 35201997
Ya...no way to do it silently over the network... :(
0
 

Author Closing Comment

by:birddog2008
ID: 35230122
No way possible to use any switch for it to be silent.  Just can't do it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

939 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question