无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 7327|回复: 14
打印 上一主题 下一主题

求一个自动创建子vhd的批处理 谢谢

[复制链接]
1#
发表于 2019-12-10 04:40:34 | 显示全部楼层
  1. @echo off
  2. if "%1"=="" goto :reg

  3. set vhd_file=%1
  4. if exist "%temp%\attach.txt" del "%temp%\attach.txt"

  5. echo select vdisk file="%vhd_file%">"%temp%\attach.txt"
  6. echo compact vdisk>>"%temp%\attach.txt"
  7. echo create vdisk file="%vhd_file:win=win_1%" parent="%vhd_file%">>"%temp%\attach.txt"
  8. diskpart /s "%temp%\attach.txt"
  9. del "%temp%\attach.txt"
  10. goto eof

  11. :reg
  12. reg add "HKCR\Windows.VhdFile\shell\vparent" /f /ve /t REG_SZ /d "建立差分VHD"
  13. reg add "HKCR\Windows.VhdFile\shell\vparent\command" /f /ve /t REG_SZ /d "D:\VHDTest\vparent.cmd %%1"
  14. goto eof
复制代码

点评

谢谢大大 我用的过程中 出现百分比的cmd窗口 过一会一闪关闭了 没有找到建立的子文件 什么原因了??大大  详情 回复 发表于 2019-12-10 10:12

评分

参与人数 1无忧币 +5 收起 理由
879792799 + 5

查看全部评分

回复

使用道具 举报

2#
发表于 2019-12-13 17:42:51 | 显示全部楼层
879792799 发表于 2019-12-10 10:12
谢谢大大  我用的过程中 出现百分比的cmd窗口 过一会一闪关闭了  没有找到建立的子文件  
什么原因了? ...

确实是,正在使用的不行。

评分

参与人数 1无忧币 +5 收起 理由
879792799 + 5 赞一个!

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-3 04:36

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表