Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to ask if there is a way to save printers from current session in Windows 7 through script? I have added some network printers through "Add a printer using a TCP/IP address or hostname". The idea is the information about printers to be saved in a file through script at the end of the session (Log off). When starting the next session (Log on), the printers from the previous session need to be loaded and seen in "Devices and Printers". The purpose is the loading of the last added printers, no matter on which computer the user has been logged in.

I would appreciate your answer!

share|improve this question
1  
If these computers are on a 2008 domain you could use Group Policy Preferences instead. Probably be easier. :) –  Ƭᴇcʜιᴇ007 Jun 12 '13 at 19:26

2 Answers 2

Generally it is best to do this through Group Policy or some sort of GP overlay, like Desktop Authority.

If you use straight-up GP, then you should find this guide helpful: http://technet.microsoft.com/en-us/library/cc722179%28v=ws.10%29.aspx

If you are using something to manage GP, than it should have a section on printers. You will want to look under user management and not computer management.

share|improve this answer

First it maybe easier via Group Policy, but here is the answer anyway.

You can do it with windows scripting.

C:\Windows\System32\Printing_Admin_Scripts\en-US

Has example scripts to use as source material.

You will need to extract the port,printer, and driver info.

You can even install printers remotely from the server using the script if you program in the some admin credentials.

Provided you don't delete the drivers between user logins. Adding the drivers every time can be a slow process.

Something like this will create a printer: You may be able to omit the "-u" "-w" "-s" flags if the operation is considered local.

C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr -u <username> -w <Password> -s <computername> -a -m "HP Universal Printing PS" -v 3 -e "Windows IA64" -i "\\<UNC to printer driver>\hpcu140v.inf" -h "\\<unc to printer driver\ps-x64-5.6.0.14430\"
C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -u <username> -w <Password> -s <computername> -d -p <printername>
C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -u <username> -w <Password> -s <computername> -d -r <printername>
C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr -a -m "HP Universal Printing PS" -v 3 -e "Windows IA64" -i "e:\HP Universal Print Driver\ps-x64-5.6.0.14430\hpcu140v.inf" -h "e:\HP Universal Print Driver\ps-x64-5.6.0.14430\"
C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -d -p <printername>
C:\Windows\System32\Printing_Admin_Scripts\en-US\prnport.vbs -d -r <printername>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.