Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

windows 7 adding printer with script

Status
Not open for further replies.

itsteapot

Technical User
Mar 27, 2009
49
GB
HI guys anyone had a play with win 7 on a domain?
I have been using a script for years to add drives on logon, guess what it wont work with win 7!
It seems to be a permission problem , it opens a dialogue box which requires an input from the user then it runs a download to add the driver. however it then will not add the printer due to a permission error.
Any ideas?
Apart from this it networks fine.
PS personally I would stay with XP but those up top......
 
I'm been running Windows 7 for about 8 months (started with RC) the following printer script has not presented an issue:

Code:
set objNetwork = WScript.CreateObject("WScript.Network")
set objShell = WScript.CreateObject("WScript.Shell")

'Add Network printers
objNetwork.AddWindowsPrinterConnection "\\nmhps01\nmhis15"
objNetwork.AddWindowsPrinterConnection "\\nmhps01\nmhis06"

'Set Default Printer
objNetwork.SetDefaultPrinter "\\nmhps01\nmhis15"

'Attrib to system, hidden and read only
objShell.Run("attrib %systemroot%\printers.vbs +r +s +h")
[\code]

Care to share your code?

Not sure if it's GPO but I was getting permission denied messages when trying to save a file to the root!  It was resolved once I took ownership of the root.

-Geates
 
will post my script Monday when I am back at work.
 
Hi I have been using this for years, server 2003, xp pro stations


rundll32 printui.dll,PrintUIEntry /in /n\\SERVERNAME\PRINTERNAME
 
does it work correctly from the commandline? i.e. forget about vbscript.
either way, if you are getting issues then just use Geates's suggestion?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top