Jump to content

Recommended Posts

Posted

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

Posted
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

  • 3 months later...
Posted

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?

Posted

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.

Posted

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

  • Thanks 1
Posted
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?

  • 3 years later...
Posted
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!

Posted

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!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...