jw项目windows环境软件安装
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
747 B

1 year ago
  1. chcp 65001
  2. @echo off
  3. %1 %2
  4. ver|find "5.">nul&&goto :Admin
  5. mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
  6. :Admin
  7. set uname=asb
  8. set new=Z:
  9. set current=%~d0
  10. for /f "tokens=2 delims==" %%a in ('wmic LogicalDisk where "VolumeName='%uname%'" get DeviceID /value') do (
  11. set old=%%a
  12. )
  13. echo 移动硬盘盘符是 %old%
  14. if %current%==%old% (
  15. echo 当前bat运行盘符和移动硬盘盘符相同!请更换bat脚本运行路径后重试
  16. pause
  17. exit
  18. ) else (
  19. goto start
  20. )
  21. :start
  22. pushd %new% 2>nul && echo %new%盘已经存在!
  23. for /f %%i in ('mountvol %old% /l') do set "vol=%%i"
  24. echo %vol%
  25. mountvol %old% /d
  26. mountvol %new% %vol%
  27. popd
  28. cd /d Z:\
  29. call 2init.bat