批处理文件删除打印机 [英] Batch file to delete printer
问题描述
我想要一个删除打印机的批处理文件,我对这应该是一个非常简单的任务感到难过。
所以我的用户可以转到'打印机和设备'并手动删除打印机没问题。
我首先尝试了一个简单的reg delete批处理文件:
reg delete" hkcu\printers\connections" / f
打印机实际上已消失,但在5-10秒或刷新后,它会重新出现在打印机和设备中。我无法理解为什么所以我继续前进。
然后我尝试了:
RUNDLL32 printui.dll,PrintUIEntry / n \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ b我显然做了一些非常愚蠢的事情,但有人能发现它是什么吗?非常感谢!
解决方案
使用Google搜索短语,例如
命令删除打印机的行
会给你很多好的提示,例如这一个:
http://www.robvanderwoude.com/2kprintcontrol .PHP 跨度>
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" /fPrinter 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 /dnBut get a message reporting arguments are invalid.
I'm clearly doing something really silly but could anyone spot what it is? Help greatly appreciated!
解决方案Using a Google search phrase such as
command line to delete printer
will give you lots of good hints, e.g. this one: http://www.robvanderwoude.com/2kprintcontrol.php
这篇关于批处理文件删除打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!