[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
本帖最后由 77七 于 2024-4-2 11:56 编辑
  1. %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~s0"" ::","","runas",1)(window.close)&&exit
  2. @echo off
  3. cd /d "%~dp0"
  4. set str=CorelDRAW Graphics Suite 2020\Programs64\Addons
  5. for %%a in (c d e f g) do (
  6. if exist "%%a:\Program Files (x86)\%str%" (
  7. robocopy . "%%a:\Program Files (x86)\%str%" /e /xf "%~f0"
  8. ) else if exist "%%a:\Program Files \%str%" (
  9. robocopy . "%%a:\Program Files \%str%" /e /xf "%~f0"
  10. )
  11. )
  12. pause
复制代码
bat小白,请多指教!谢谢!

TOP

回复 6# aabout2008


  
  1. %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~s0"" ::","","runas",1)(window.close)&&exit
  2. @echo off
  3. cd /d "%~dp0"
  4. set str=CorelDRAW Graphics Suite 2020\Programs64\Addons
  5. for %%a in (c d e f g) do (
  6. if exist "%%a:\Program Files (x86)\%str%" (
  7. set _str=%%a:\Program Files (x86)\%str%
  8. ) else if exist "%%a:\Program Files \%str%" (
  9. set _str=%%a:\Program Files \%str%
  10. )
  11. )
  12. for %%a in (.) do (
  13. robocopy . "%_str%\%%~nxa" /e /xf "%~f0"
  14. )
  15. pause
复制代码
1

评分人数

bat小白,请多指教!谢谢!

TOP

本帖最后由 77七 于 2024-4-2 15:20 编辑

回复 9# aabout2008


   改一下第7行,这个if 和 ()总是容易出错
  1. set "_str=%%a:\Program Files (x86)\%str%"
复制代码

bat小白,请多指教!谢谢!

TOP

回复 18# aabout2008


  
  1. start "" "%_str%"
复制代码
bat小白,请多指教!谢谢!

TOP

回复 21# aabout2008


   写在pause 上一行就行
bat小白,请多指教!谢谢!

TOP

返回列表