Sign in to follow this  
Followers 0
ss3vegeta

Adding drivers to driver store using pnputil

5 posts in this topic

Hi,

I am simply trying to write a script to help deploy printers and I have run into a bit of a snag. I cannot get the cmd window to open with the proper elevation to run commands like:

pnputil -i -a c:\print_drivers\driverstore\hp001a\prnhp001.inf

I can run this command manually from an elevated command line prompt without issue, however it will not work using:

#RequireAdmin

and/or

RunAsWait($adminAcct, @ComputerName, $adminPass, 0, @ComSpec & " /k pnputil -i -a c:\print_drivers\driverstore\hp001a\prnhp001.inf")

I get an error that says: "Adding the driver packaged failed : Access is denied."

Any advice would be greatly appreciated.

Share this post


Link to post
Share on other sites



Forgot to say win7 64 ultimate, not sure that matters.

Share this post


Link to post
Share on other sites

put a sleep in your process to verify it is running as the user you think you are it may be an issue with the credentials you may also use the /f force pnputil

Share this post


Link to post
Share on other sites

put a sleep in your process to verify it is running as the user you think you are it may be an issue with the credentials you may also use the /f force pnputil

How would I put a pause in the process to check? It pops up and leaves very quickly.

Do you mean to use -f with pnputil? I think force can only be used to delete from the driver store.

Share this post


Link to post
Share on other sites

I figured it out, the problem was that I was using the wrong flag. I needed to use 2 instead of 0.

RunAsWait($adminAcct, @ComputerName, $adminPass, 2, @ComSpec & " /k pnputil -i -a c:print_driversdriverstorehp001aprnhp001.inf")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0