Trihimbulus
asked on
VB Script to remove local printer and network printer
I need a script that will delete two printers on each workstation. One of the printers is a local printer named PIK 7000. With this, I also need it's associated custom port deleted which is named PIK 0. Also, I need all associated drivers removed. These drivers are primarily located in the below locations:
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\ka*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\ki*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\ku*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\2\ka* .*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\2\ki* .*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\2\ku* .*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\2\tem p\ka*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\2\tem p\ki*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\2\tem p\ku*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\3\ka* .*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\3\ki* .*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\3\ku* .*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\3\tem p\ka*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\3\tem p\ki*.*
del /F /Q C:\Windows\System32\Spool\ Drivers\W3 2x86\3\tem p\ku*.*
del /F /Q C:\Windows\System32\kaw2kp pm.dll
del /F /Q C:\Windows\System32\kuwxpp m.dll
** One side note - after deleting the files above, the driver still show up in Printers and Faxes > Server Properties > Drivers.
The other printer I need to be deleted from each workstation (in the same script) is named Plotter PIK 7000. This is a network printer and the UNC path is \\printserver\Plotter PIK 7000.
*** Side note - is there a way to target any associated drivers to be deleted?
Lastly I need the following registry key to be deleted from each workstation in this same script:
[HKEY_LOCAL_MACHINE\SYSTEM \CurrentCo ntrolSet\C ontrol\Pri nt\Monitor s\PIKMonit or]
Let the battle Begin :)
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\Spool\
del /F /Q C:\Windows\System32\kaw2kp
del /F /Q C:\Windows\System32\kuwxpp
** One side note - after deleting the files above, the driver still show up in Printers and Faxes > Server Properties > Drivers.
The other printer I need to be deleted from each workstation (in the same script) is named Plotter PIK 7000. This is a network printer and the UNC path is \\printserver\Plotter PIK 7000.
*** Side note - is there a way to target any associated drivers to be deleted?
Lastly I need the following registry key to be deleted from each workstation in this same script:
[HKEY_LOCAL_MACHINE\SYSTEM
Let the battle Begin :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.