[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. @echo off
  2. for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get name') do (
  3.     for /f "delims=" %%e in ('dir /s /b %%i\XX.exe 2^>nul') do (
  4.         set "fullpath=%%~e"
  5.         goto :breakloop
  6.     )
  7. )
  8. goto :eof
  9. :breakloop
  10. if exist "%fullpath%" (
  11.     start "" "%fullpath%"
  12. )
复制代码

TOP

回复 3# xxez
  1. @echo off
  2. set "firstlook=test\folder\myfolder"
  3. for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get name') do (
  4.     for /f "delims=" %%e in ('dir /s /b "%%i\%firstlook%\XX.exe" 2^>nul') do (
  5.         set "fullpath=%%~e"
  6.         if exist "%fullpath%" (
  7.             goto :breakloop
  8.         )
  9.     )
  10. )
  11. for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=3" get name') do (
  12.     for /f "delims=" %%e in ('dir /s /b %%i\XX.exe 2^>nul') do (
  13.         set "fullpath=%%~e"
  14.         if exist "%fullpath%" (
  15.             goto :breakloop
  16.         )
  17.     )
  18. )
  19. goto :eof
  20. :breakloop
  21. start "" "%fullpath%"
复制代码

TOP

返回列表