DMcCoy Posted October 17, 2005 Posted October 17, 2005 @DMcCoy Would love the WMI script you can do it within the vbs file, but again, this one has to run as the startup script (in fact I guess it can be a seperate startup script on its own). I think this is the relevant bit, test it first strComputer = "." Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colInstalledPrinters = objWMIService.ExecQuery ("SELECT * FROM Win32_Printer") For Each objPrinter in colInstalledPrinters IF objPrinter.Name = "Microsoft Office Document Image Writer" THEN objPrinter.Delete_ END IF Next mind the word wrap
MkII Posted October 17, 2005 Posted October 17, 2005 which is... [hehe] Is that it? is that the path? - not a reference to any specific path or machine - but syntax for the WMI root path generically?
DMcCoy Posted October 17, 2005 Posted October 17, 2005 which is... [hehe] Is that it? is that the path? - not a reference to any specific path or machine - but syntax for the WMI root path generically? It belongs on the end of the second line but got wrapped. I don't know much about WMI, but I'm guessing the "." bit sets it to the local machine. You can see it in: Computer Managment, WMI Control then right click, properties, security.
Geoff Posted October 17, 2005 Posted October 17, 2005 Its a string concatination. The full path for the GetObject call ends up as: winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2 First bit is the protocol (winmgmts), second bit is the impersonation level ({impersonationLevel=impersonate}) last bit is the path, the \\. means the local machine. You could use \\RANDOMSERVER01 instead if you wanted to access things remotely over the network. Last bit is the WMI root path as I've explained. Why is it such an unobvious mess of ASCII? I've no idea, ask Microsoft.
MkII Posted October 17, 2005 Posted October 17, 2005 Hey- run the script [as is! ] and it worked a treat! thanks
klawd Posted May 13, 2006 Posted May 13, 2006 Am I allowed to do a blatant ad for a small utility I wrote and just uploaded to the download section? Makes things a whole lot easier, no spyware or other junk, just posting something hopefully others will find useful. http://printing.networkstuff.co.uk for instructions and download.
Ric_ Posted May 13, 2006 Posted May 13, 2006 @klawd: Free utilities written by our members are welcomed and often encouraged. After all, why re-invent the wheel? If you would like to open the source, I'm sure our members would love to help you develop it further.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now