联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off :: BOOT.INI attrib c:\boot.ini -s -h -r -a if not exist c:\boot.ini goto end for /f "eol=; delims== tokens=1" %%a in ('type c:\boot.ini ^|findstr "multi"') do @set multi=%%a if %multi%*==* goto end for /f "tokens=6 delims=()" %%a in ('type c:\boot.ini^|findstr /i "rdisk"') do @set rd=%%a if "%rd%"=="1" set rdisk=2 if "%rd%"=="0" set rdisk=1 for /f "tokens=8 delims=()" %%a in ('type c:\boot.ini 2^>nul^|findstr /i "partition"') do @set partition=%%a :: Lastdrive setlocal EnableDelayedExpansion set drives= CDEFGHIJKLMNOPQRSTUVWXYZ for /f %%i in ('wmic logicaldisk where "drivetype=3" get FileSystem ^| find /c "FAT"') do set lastdrive=!drives:~%%i,1!: if %lastdrive%*==C:* goto end if %lastdrive%*== :* goto end :: BACKUP if not exist %lastdrive%\BACKUP\nul md %lastdrive%\BACKUP copy Ghost32.exe %lastdrive%\BACKUP /y>nul copy GhostExp.exe %lastdrive%\BACKUP /y>nul :: CREATE.TXT echo -CLONE,MODE=PCREATE,SRC=%rdisk%:%partition%,DST=%lastdrive%\BACKUP\H%rdisk%P%partition%.GHO>%lastdrive%\BACKUP\CREATE.TXT echo -SKIP=\PAGEFILE.SYS>>%lastdrive%\BACKUP\CREATE.TXT echo -SURE>>%lastdrive%\BACKUP\CREATE.TXT echo -RB>>%lastdrive%\BACKUP\CREATE.TXT :: RESTORE.TXT echo -CLONE,MODE=PRESTORE,SRC=%lastdrive%\BACKUP\H%rdisk%P%partition%.GHO:1,DST=%rdisk%:%partition%>%lastdrive%\BACKUP\RESTORE.TXT echo -SURE>>%lastdrive%\BACKUP\RESTORE.TXT echo -RB>>%lastdrive%\BACKUP\RESTORE.TXT :end attrib c:\boot.ini +s +h -a set multi= set rd= set partition= set drives= set lastdrive=