Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- cd "C:\Users\Dominic Skinner\"
- REM --------------------------------------------------------------------
- REM This script mounts a VHD image "disk.vhd" from the current directory
- REM To change the drive letter, set it manually (first time only)
- REM --------------------------------------------------------------------
- REM Configuration
- REM -------------
- SET VirtualDiskLocation="%CD%\secure.vhd"
- SET DiskPartScriptLocation="%TEMP%\DiskMountScript-%RANDOM%.txt"
- REM Write to the temporary script file
- REM ----------------------------------
- ECHO SELECT VDISK FILE=%VirtualDiskLocation% > %DiskPartScriptLocation%
- ECHO ATTACH VDISK >> %DiskPartScriptLocation%
- REM Execute the script
- REM ------------------
- ECHO Mounting %VirtualDiskLocation%...
- DiskPart /s %DiskPartScriptLocation%
- REM Cleanup
- REM -------
- DEL %DiskPartScriptLocation%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement