批处理文件有问题
我创建了一个批处理文件来卸载我的应用程序。 我的问题是,结果是,此卸载删除了一些文件,但保留了其他文件。
例如,我在 C:\\Documents and settings\User-Name\myCompanyName\My Application name\
中创建了一个文件夹 该文件夹包含我的应用程序的所有文件。 现在,当我卸载时,所有这些文件都被删除。 但我也想从“C:\Documents and settings\User-Name”中删除“myCompanyName”文件夹
与前一个问题相关的另一个问题是我在开始菜单中添加了一个名为 myComapny
它包含 4 个文件:
- exe 文件、
- 配置文件
- 、帮助文件和
- 卸载文件。
当我单击卸载文件时,它会删除所有内容,但仍然保留开始菜单中包含我刚才的四个文件的文件夹列出。
如何通过批处理文件删除不需要的文件夹?
这是我的批处理文件代码:
@echo off
msiexec /x {DD75996F-C279-420A-9A19-48EF9EFE70C2}
RD /s "C:\Program Files\ASGATech"
RD /s "C:\Documents and Settings\%userprofile%\start menu\programs\ASGATech"
pause
注意:我尝试将批处理文件的扩展名从 bat
更改为 cmd
我还尝试让当前登录用户 %userprofile% 转到他/她的开始菜单。 如果此方法有误,请告知我。
I created a batch file, to uninstall my application. My problem is that as result, this uninstallation deleted some files but kept others.
For example one, I created a folder in C:\\Documents and settings\User-Name\myCompanyName\My Application name\
This folder contains all files for my application. Now when I uninstall, all these files are deleted. But I want to delete "myCompanyName" folder too from "C:\Documents and settings\User-Name"
The other problem tied with the previous one is that I added a new folder to the start menu called myComapny
It holds 4 files:
- exe file
- config file
- help file, and
- uninstall file
When I click on the uninstall file, it removes everything but still keeps the folder in the start-menu containing the four files I just listed.
How could I delete the unwanted folders through the batch file?
Here is my batch file code:
@echo off
msiexec /x {DD75996F-C279-420A-9A19-48EF9EFE70C2}
RD /s "C:\Program Files\ASGATech"
RD /s "C:\Documents and Settings\%userprofile%\start menu\programs\ASGATech"
pause
NOTE: I tried to change the extension of the batch file from bat
to cmd
I also tried to get the current login user %userprofile% to go to his/her start menu. If this way is wrong, please inform me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除 C:\Documents and Settings - 它已位于 %userprofile% 标记中。
RD /s“%userprofile%\开始菜单\程序\ASGATech”
Remove the C:\Documents and Settings - this is already in the %userprofile% tag.
RD /s "%userprofile%\start menu\programs\ASGATech"