|
原帖由 2012秋风落叶 于 2012-6-23 20:54 发表
我想用批处理搜索一个程序 rar.exe的程序,搜索到后并且是带参数 /s /q运行,
请问该怎么写
下面是我根据坛友帖子写的,怎么把/s /q两个参数加进去呢
大家知道rar程序加了/s /q之后就可以静默安装啦,我要的 ...
全盘搜索前 先找注册表
- if exist "%ProgramFiles%\winrar\rar.exe" (
- set RarPath=%ProgramFiles%\winrar
- ) else if exist "%ProgramFiles(x86)%\winrar\rar.exe" (
- set "RarPath=%ProgramFiles(x86)%\winrar"
- ) else (
- reg query HKLM\software\winrar /v exe64>nul 2>nul
- if errorlevel 1 (
- reg query HKLM\software\winrar /v exe32>nul 2>nul
- if errorlevel 1 (
- echo Winrar may not be install in your machine.
- ) else if errorlevel 0 (
- for /f "usebackq tokens=2,*" %%A in (`reg query HKLM\software\winrar /v exe32^|find /i "exe32"`) do set RarPath=%%B
- )
- ) else if errorlevel 0 (
- for /f "usebackq tokens=2,*" %%A in (`reg query HKLM\software\winrar /v exe64^|find /i "exe64"`) do set RarPath=%%B
- )
- )
复制代码 |
|