使用批处理删除桌面图标?
我正在尝试创建一个批处理,该批处理将从桌面删除图标,但它不起作用,有人可以详细说明吗?
del "%userprofile%\Bureaublad\AutoCAD 2006.ico"
我的问题的第二部分,%userprofile% 在工作中工作正常,但这对家用电脑有效吗?
I'm trying to create a batch that will delete an icon from the desktop however its not working could anyone elaborate on this?
del "%userprofile%\Bureaublad\AutoCAD 2006.ico"
Second part of my question, the %userprofile% works fine at work however is this valid with home pc's?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许您的脚本等待删除文件的确认?
尝试:
maybe Your script waits the confirmation of deleting file?
try:
你的代码应该运行得很好...你的意思是程序链接吗?那么扩展名必须是 .lnk 吗?
所以它会是:
应该适用于任何 Windows PC - 唯一的问题可能是 Vista 及更高版本的 UAC。
your code should be working wonderfully...do you maybe mean a program link? Then the extension would have to be .lnk ?
so it would be:
Should work with any windows Pc - only problem could be UAC with Vista and upwards.
那么,%userprofile% 将使您进入用户目录,而不是桌面目录。尝试编写类似
Btw 的内容,如果您所说的“图标”实际上是指相关应用程序的快捷方式,则扩展名不是 .ico 而是 .lnk
,是的,%userprofile% 也应该在您的家用电脑上工作。
PS:以上所有内容均假设您使用的是Windows。
Well, %userprofile% will get you to the User directory, not the Desktop directory. Try writing something like
Btw, if you by "icon" actually mean the shortcut for the application in question the extension would not be .ico but .lnk
And yes, %userprofile% should work on your home PC as well.
PS: All of the above is assuming that you are using Windows.