2015年5月29日 星期五

Mount and dismount hard drive through a script on Windows 7

Reference:
Mount and dismount hard drive through a script

find volume name command: mountvol

umount script:
@echo off
REM Be sure to change this to the drive you want to unmount!
set drive=G:
echo Unmounting Drive...
mountvol %drive% /p
echo Drive Unmounted!
pause
exit

mount script:
@echo off
REM Be sure to change this to the drive letter you want to mount the drive to!
set drive=G
REM Be sure to change this to the Volume Name of the drive you want to mount!
set volume=\\?\Volume{ae101d9f-7653-11e3-be83-8056f23387a6}\
:start
echo Mounting Drive...
mountvol %drive%: %volume%
echo Drive Mounted!
pause
exit

在 Windows 7 執行這兩個 script 需要 Run as Administrator。
如果想直接執行必須 disable UAC。

沒有留言:

張貼留言