当前位置:网站首页>Managing VHDS using batch
Managing VHDS using batch
2022-06-11 05:45:00 【zhmhbest】
VHD Script
List of articles
Create
@echo off
set VHD_File=E:\Temp\test.vhd
set VHD_Label=Temp
set VHD_Size=100
REM size = ?m
set VHD_Type=expandable
REM type = fixed | expandable
REM ================
if exist "%VHD_File%" exit
set VHD_Script=%Temp%\VHD_Script%Random%
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [create]
echo create vdisk file="%VHD_File%" maximum=%VHD_Size% type=%VHD_Type% > "%VHD_Script%"
echo select vdisk file="%VHD_File%" >> "%VHD_Script%"
echo attach vdisk >> "%VHD_Script%"
echo create partition primary >> "%VHD_Script%"
echo active >> "%VHD_Script%"
echo format fs=ntfs quick label="%VHD_Label%" >> "%VHD_Script%"
echo detach vdisk >> "%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
Attach & Mount
@echo off
set VHD_File=E:\Temp\test.vhd
set VHD_Path=I:
REM ================
if not exist "%VHD_File%" exit
set VHD_Script=%Temp%\VHD_Script%Random%
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [attach]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo attach vdisk >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
ping -n 2 127.0.0.1>nul
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [mount]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo select partition=1 >>"%VHD_Script%"
echo assign mount="%VHD_Path%" >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
Remove & Detach
@echo off
set VHD_File=E:\Temp\test.vhd
REM ================
if not exist "%VHD_File%" exit
set VHD_Script=%Temp%\VHD_Script%Random%
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [remove]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo select partition=1 >>"%VHD_Script%"
echo remove >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
ping -n 2 127.0.0.1>nul
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [detach]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo detach vdisk >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
Remount
@echo off
set VHD_File=E:\Temp\test.vhd
set VHD_Path=H:
REM ================
if not exist "%VHD_File%" exit
set VHD_Script=%Temp%\VHD_Script%Random%
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [attach]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo attach vdisk >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
ping -n 2 127.0.0.1>nul
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [remove]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo select partition=1 >>"%VHD_Script%"
echo remove >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
ping -n 2 127.0.0.1>nul
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
echo [mount]
echo select vdisk file="%VHD_File%" >"%VHD_Script%"
echo select partition=1 >>"%VHD_Script%"
echo assign mount="%VHD_Path%" >>"%VHD_Script%"
call diskpart /s "%VHD_Script%"
del "%VHD_Script%"
REM ■■■■■■■■■■■■■■■■ ■■■■■■■■■■■■■■■■
边栏推荐
- NDK learning notes (12) native graphics API, using avilib to create an avi video player
- 【深入kotlin】 - Flow 进阶
- NDK learning notes (V)
- In the future, how long will robots or AI have human creativity?
- 智能门锁为什么会这么火,米家和智汀的智能门锁怎么样呢?
- js promise,async,await简单笔记
- YOLOv5的Tricks | 【Trick8】图片采样策略——按数据集各类别权重采样
- Activity start process record
- NDK learning notes (VIII) thread related
- “All in ONE”一个平台解决所有需求,运维监控3.0时代已来
猜你喜欢

If the MAC fails to connect with MySQL, it will start and report an error

Recommend a free intranet penetration open source software that can be used in the local wechat official account under test

MySQL string to array, merge result set, and convert to array

智能门锁为什么会这么火,米家和智汀的智能门锁怎么样呢?

Preliminary understanding of multi task learning

22. Generate parentheses

Wechat applet, automatic line feed for purchasing commodity attributes, fixed number of divs, automatic line feed for excess parts

SQLite installation and configuration tutorial +navicat operation

C (I) C basic grammar all in one

NDK learning notes (I)
随机推荐
Utiliser le fichier Batch Enum
Combing route - Compaction Technology
我们真的需要会议耳机吗?
Informatica:数据质量管理六步法
Use of vlayout
More than 20 cloud collaboration functions, 3 minutes to talk through the enterprise's data security experience
Control your phone with genymotion scratch
Analysis while experiment - a little optimization of memory leakage in kotlin
Stone game -- leetcode practice
NDK learning notes (x) POSIX socket for connectionless communication
Elk log system practice (V): install vector and output data to es and Clickhouse cases
Recherche sur l'optimisation de Spark SQL basée sur CBO pour kangourou Cloud Stack
Multithreading tutorial (XXVII) CPU cache and pseudo sharing
Aurora im live chat
Recursively process data accumulation
In the future, how long will robots or AI have human creativity?
Wxparse parsing iframe playing video
Fix Yum dependency conflict
NDK learning notes (IX) POSIX sockect connection oriented communication
getBackgroundAudioManager控制音乐播放(类名的动态绑定)