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.
|
|
chcp 65001 @echo off %1 %2 ver|find "5.">nul&&goto :Admin mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof :Admin set uname=asb set new=Z: set current=%~d0 for /f "tokens=2 delims==" %%a in ('wmic LogicalDisk where "VolumeName='%uname%'" get DeviceID /value') do ( set old=%%a ) echo 移动硬盘盘符是 %old% if %current%==%old% ( echo 当前bat运行盘符和移动硬盘盘符相同!请更换bat脚本运行路径后重试 pause exit ) else ( goto start )
:start pushd %new% 2>nul && echo %new%盘已经存在! for /f %%i in ('mountvol %old% /l') do set "vol=%%i" echo %vol% mountvol %old% /d mountvol %new% %vol% popd cd /d Z:\ call 2init.bat
|