我是一个公司负责装机发货的职工。以前为了方便自己上网查教程写了批处理来自动分区拷贝数据并自行恢复系统来提高工作效率。但是现在GPT的分区我遇到了问题。以前可以通过盘符来拷贝数据,现在盘符总是变动我想不通过盘符来拷贝数据,但是不知道怎么搜索关键字,无奈跑到论坛来求助。以下是自己在网上复制粘贴七拼八凑的批处理命令,现在希望论坛大佬帮忙修改下。原来是分4个区,是MBR。现在是GPT,多了一个EFI分区和MSR分区。还有我要从U盘里拷贝数据到电脑硬盘的第二分区,第三分区,第四分区里。在这里先行谢过大佬!- @echo off
- cls
- echo ╔═══════╗
- echo ║高清工作站分区║
- echo ╚═══════╝
- echo.
- echo =======================
- echo 正在清除分区,请稍后...
- echo =======================
- echo select disk 0 > logical1.txt
- echo clean >> logical1.txt
- echo exit >> logical1.txt
- @start /min /wait diskpart /s logical1.txt
- del logical1.txt
- echo.
- echo 清除分区成功
- echo ============
- echo.
- echo 正在创建主分区......
- echo ====================
- echo select disk 0 > logical1.txt
- echo create partition primary size=102400 >> logical1.txt
- echo format quick >> logical1.txt
- echo active >> logical1.txt
- echo assign letter=C >> logical1.txt
- echo exit >> logical1.txt
- @start /min /wait diskpart /s logical1.txt
- del logical1.txt
- echo 创建主分区成功
- echo ==============
- echo.
- echo 正在创建扩展分区......
- echo ======================
- echo select disk 0 > logical1.txt
- echo create partition extended >> logical1.txt
- echo exit >> logical1.txt
- @start /min /wait diskpart /s logical1.txt
- del logical1.txt
- echo 创建扩展分区成功
- echo ================
- echo.
- echo 正在创建逻辑分区1......
- echo =======================
- echo select disk 0 > logical1.txt
- echo create partition logical size=1536000 >> logical1.txt
- echo format quick >> logical1.txt
- echo assign letter=D >> logical1.txt
- echo exit >> logical1.txt
- @start /min /wait diskpart /s logical1.txt
- del logical1.txt
- echo 创建逻辑分区1成功
- echo =================
- echo.
- echo 正在创建逻辑分区2......
- echo =======================
- echo select disk 0 > logical1.txt
- echo create partition logical size=245760 >> logical1.txt
- echo format quick >> logical1.txt
- echo assign letter=E >> logical1.txt
- echo exit >> logical1.txt
- @start /min /wait diskpart /s logical1.txt
- del logical1.txt
- echo 创建逻辑分区2成功
- echo =================
- echo.
- echo 正在创建逻辑分区3......
- echo =======================
- echo select disk 0 > logical1.txt
- echo create partition logical >> logical1.txt
- echo format quick >> logical1.txt
- echo assign letter=F >> logical1.txt
- echo exit >> logical1.txt
- @start /min /wait diskpart /s logical1.txt
- del logical1.txt
- echo 创建逻辑分区3成功
- echo =================
- echo 拷贝还原镜像
- echo ============
- md E:\Ghost
- copy /y/z U:\Ghost\HD\FirstBackup.gho E:\Ghost\
- echo 拷贝Disk
- echo ========
- md F:\Disk
- echo off
- xcopy /y/z U:\Disk\TOOLS\*.exe F:\Disk
- xcopy U:\Disk\D430(6400) F:\Disk\D430(6400) /e/i
- xcopy U:\Disk\Ghost F:\Disk\Ghost /e/i
- xcopy U:\Disk\Office2003 F:\Disk\Office2003 /e/i
- xcopy U:\Disk\SQL2000 F:\Disk\SQL2000 /e/i
- xcopy U:\Disk\广州高通软件高清 F:\Disk\广州高通软件高清 /e/i
- xcopy U:\Disk\输入法 F:\Disk\输入法 /e/i
- F:\Disk\Ghost\ghost32.exe -clone,mode=pload,src=E:\Ghost\FirstBackup.gho:1,dst=1:1 -fx -sure -rb
- pause
复制代码
|