我有目录结构:
DIR
|-UNINSTALL.BAT
|-component_name
|-source
|-setup.exe
|-uninst.bat
|-another_component_name
|-source
|-setup.exe
|-uninst.bat
|-yet_another_component_name
|-source
|-setup.exe
|-uninst.bat
等等……
在像“component_name”这样的每个目录中,我都有 setup.exe
文件,它将当前组件安装到 Delphi 中的调色板组件。
uninst.bat
只包含这个字符串:
"setup.exe"/uninstall
所以我需要在 DIR
中编写 UNINSTALL_ALL.bat
,它将在所有组件目录中运行 uninst.bat。
提前谢谢你。
最佳答案
你可以用这条线来做:
for /f %%a in ('dir /b /s uninst.bat') do call %%a
请注意,'%%' 是批处理文件所必需的。如果你在命令行上测试它,只使用一个 '%'
关于windows - 如何从 .bat 循环运行 *.exe/key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1024787/