atfnet Posted May 21, 2007 Posted May 21, 2007 Hi, Is there a way to remove the MS XPS Document Writer and Symantec Fax Starter Edition virtual printers ? preferably via a cmd script or vbs. Thanks Andy
DMcCoy Posted May 21, 2007 Posted May 21, 2007 I had a script that did the Microsoft document imager with wmi, I'll see if I can find it
DMcCoy Posted May 21, 2007 Posted May 21, 2007 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 XPS Document Writer" THEN objPrinter.Delete_ END IF Next
indie Posted September 11, 2007 Posted September 11, 2007 I get an access denied error for this script on line 6, any reason why it would be doing that? "objPrinter.Delete_" Just using it as a logon script in a group policy, is it that the script doesnt have the rights to delete the local XPS Document driver or something?
DMcCoy Posted September 11, 2007 Posted September 11, 2007 needs to be a startup script so it runs with the system account
indie Posted September 11, 2007 Posted September 11, 2007 Do startup scripts get executed before the login scripts? It's just I've got a login script that sets up the printers on the machine so i need the xps driver deleting first so that the 1st printer that gets set up in the printers script becomes the default.
Lithium Posted September 11, 2007 Posted September 11, 2007 Startup scripts go before the computer even reaches the Ctrl Alt Del screen.
Ste_Harve Posted September 12, 2007 Posted September 12, 2007 Would i be able to edit the script to delete the macromedia flash paper printer? If so which bit do i need to alter? Cheers, Ste
Geoff Posted September 12, 2007 Posted September 12, 2007 Have a look at this script, it's slightly modified to delete the XPS writer and the Image writer. 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_ ELSEIF objPrinter.Name = "Microsoft XPS Document Writer" THEN objPrinter.Delete_ END IF Next 1
indie Posted September 12, 2007 Posted September 12, 2007 Startup scripts go before the computer even reaches the Ctrl Alt Del screen. Maybe I'm just being stupid but does this need to applied to the domain group policy then? If I apply this to my students group policy how would the computer know to run the script before it even knows that a student is logging on? @Geoff Will the script crap out if it tries to delete a printer that doesn't exist? Some of our clients have the Microsoft Office Document Image Writer printer, some dont, will it be OK to use the one script that deletes the XPS driver and the Image Writer drive on all the machines?
Geoff Posted September 12, 2007 Posted September 12, 2007 The script runs silently regardless of the status of printers on the PC.
emerald0517 Posted July 10, 2011 Posted July 10, 2011 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 XPS Document Writer" THEN objPrinter.Delete_ END IF Next CAN SOMEONE PLEASE TELL ME WHERE TO WRITE THIS SCRIPT...PLEASE, IM SO FED UP WITH THIS SH. I DONT KNOW ANYTHING ABOUT THIS BUT I HAVE TO GET RID OF XPS, ITS DRIVING ME CRAZY. WHERE AND WHEN TO ENTER THIS SCRIPT. I HAVE A PC WITH WINDOWS 7 AND ITS JUST MY SINGLE PC. THANK YOU!
Arthur Posted July 10, 2011 Posted July 10, 2011 If you are using Windows 7, run the following from an elevated Command Prompt to disable the XPS printer. DISM /Online /Disable-Feature /FeatureName:Printing-XPSServices-Features BTW, there's no need to shout!
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