windows7使用vhd虚拟磁盘

操作系统 : windows7_x64

创建vhd

磁盘管理 --> 操作 --> 创建vhd

挂载vhd

脚本:

rem 挂载VHD
@echo off
(echo select vdisk file="D:\workspace\srcRead.vhd"
 echo attach vdisk)>"%tmp%\vhd.sh"
diskpart /s "%tmp%\vhd.sh"
pause

Python版本:

https://github.com/mike-zhang/pyExamples/blob/master/tools/vhdFileOpt/load_vhd.py

卸载vhd

脚本:

rem 卸载VHD
(echo select vdisk file="D:\workspace\srcRead.vhd"
 echo detach vdisk)>"%tmp%\vhd.sh"
diskpart /s "%tmp%\vhd.sh"
pause

Python版本:

https://github.com/mike-zhang/pyExamples/blob/master/tools/vhdFileOpt/unload_vhd.py

本文github地址:

https://github.com/mike-zhang/mikeBlogEssays/blob/master/2019/20190815_windows7使用vhd虚拟磁盘.rst

欢迎补充

posted on 2019-08-15 21:53  Mike_Zhang  阅读(601)  评论(0编辑  收藏  举报