I'm having a hell of a job getting a script to run under Server 2008 R2. It's simple enough, works under all other recent versions of MS Windows - XP, Server 2003, Win 7, Server 2008.
It started off with a cmd line PRINTUI entry to capture default settings of printers, viz:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Ss /n <printer> /a c:\printer.bin
then to restore:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n <printer> /a c:\printer.bin g d u
where <printer> is the name of the printer
These 2 command line functions work well in all recent versions of MS Windows, except Server 2008 R2. On Server 2008 R2, I get an error code 0000000c. Tested on two different installations of Server 2008 R2, so it's not just my setup.
A look into technet mentioned that any cmd line functions should now be scripted. Being a complete noob @ scripting, a colleague wrote a Q&D script:
set wshell = CreateObject("WScript.Shell")
wshell.run "RUNDLL32 PRINTUI.DLL,PrintUIEntry /Sr /n PRINTER /a c:\printer.bin g d u", 0, TRUE
set wshell = nothing
msgbox "OK"
Again, this script does not work on Server 2008 R2, not even the expected OK dialog box. No error codes, nada. Script works OK on any previous Windows versions.
What the heck am I doing wrong ?