系统相关
首页 > 系统相关> > windows7使用vhd虚拟磁盘

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

欢迎补充

标签:github,tmp%,echo,vdisk,windows7,sh,磁盘,vhd
来源: https://www.cnblogs.com/MikeZhang/p/win7loadvhd20190815.html