Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Batch file to delete printer

$
0
0

Hi,

I'd like a batch file to delete a printer and I'm stumped at what should be a pretty simple task.

So my user can go to 'Printers and Devices' and manually remove the printer no problem.

I first tried a simple reg delete batch file: 

reg delete "hkcu\printers\connections" /f

Printer does actually disappear but after 5-10secs or a refresh, it reappears in Printers and devices. I couldn't work out why so I moved on.

I then tried:

RUNDLL32 printui.dll,PrintUIEntry /n \\server\printer name /dn

But get a message reporting arguments are invalid.

I'm clearly doing something really silly but could anyone spot what it is? Help greatly appreciated!


Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>