Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. @ECHO OFF
  2. cd "C:\Users\Dominic Skinner\"
  3. REM --------------------------------------------------------------------
  4. REM This script mounts a VHD image "disk.vhd" from the current directory
  5. REM To change the drive letter, set it manually (first time only)
  6. REM --------------------------------------------------------------------
  7.  
  8. REM Configuration
  9. REM -------------
  10. SET VirtualDiskLocation="%CD%\secure.vhd"
  11. SET DiskPartScriptLocation="%TEMP%\DiskMountScript-%RANDOM%.txt"
  12.  
  13. REM Write to the temporary script file
  14. REM ----------------------------------
  15. ECHO SELECT VDISK FILE=%VirtualDiskLocation% > %DiskPartScriptLocation%
  16. ECHO ATTACH VDISK >> %DiskPartScriptLocation%
  17.  
  18. REM Execute the script
  19. REM ------------------
  20. ECHO Mounting %VirtualDiskLocation%...
  21. DiskPart /s %DiskPartScriptLocation%
  22.  
  23. REM Cleanup
  24. REM -------
  25. DEL %DiskPartScriptLocation%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement