Last active
May 9, 2023 12:35
-
-
Save oaeide/978f2f04e2a85cfecac2 to your computer and use it in GitHub Desktop.
Script for mounting and unmounting VHD files in windows via send to menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
TITLE Mount VHD | |
SETLOCAL | |
SET DiskPartScript="%TEMP%DiskpartScript.txt" | |
ECHO SELECT VDISK FILE="%~1" > %DiskPartScript% | |
ECHO ATTACH VDISK >> %DiskPartScript% | |
DiskPart /s %DiskPartScript% | |
ENDLOCAL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
TITLE Unmount VHD | |
SETLOCAL | |
SET DiskPartScript="%TEMP%DiskpartScript.txt" | |
ECHO SELECT VDISK FILE="%~1" > %DiskPartScript% | |
ECHO DETACH VDISK >> %DiskPartScript% | |
DiskPart /s %DiskPartScript% | |
ENDLOCAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment