Save printers from current session - Windows 7

1

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!

Petar Enchev

Posted 2013-06-12T18:50:22.587

Reputation: 11

1If these computers are on a 2008 domain you could use Group Policy Preferences instead. Probably be easier. :) – Ƭᴇcʜιᴇ007 – 2013-06-12T19:26:09.297

Answers

1

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.

Wolves

Posted 2013-06-12T18:50:22.587

Reputation: 335

1

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>

cybernard

Posted 2013-06-12T18:50:22.587

Reputation: 11 200