标题: [其他] 新人求助 批处理怎样忽略其中的某一个exe文件? [打印本页]
作者: shiyi1988 时间: 2012-8-17 13:54 标题: 新人求助 批处理怎样忽略其中的某一个exe文件?
本帖最后由 shiyi1988 于 2012-8-17 15:14 编辑
- @echo off
- cls
- echo 正在安装补丁
- for /r %%i in (*.exe) do echo 安装%%~ni.exe && %%i /quiet /norestart
- echo windows重启系统使设置生效!
- exit
复制代码
跳过其中某一个exe文件,如目录下有a.exe、b.exe、c.exe、d.exe 只运行b.exe、c.exe、d.exe 而不运行a.exe怎么改
作者: apang 时间: 2012-8-17 15:27
- @echo off
- cls&echo 正在安装补丁
- for /r %%i in (*.exe) do (
- if /i not "%%~ni"=="a" echo 安装%%~ni.exe && "%%i" /quiet /norestart
- )
- echo windows重启系统使设置生效!
- pause
复制代码
作者: shiyi1988 时间: 2012-8-17 15:48
回复 2# apang
谢谢
作者: 狗屁不通 时间: 2012-8-17 22:29
这样也可以:- dir /a-d /b|find "a.exe"&&start list.bat ||echo a.exe不存在
复制代码
list.bat- start b.exe
- start c.exe
- start d.exe
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |