@echo off
mode con cols=80 lines=31&color fc
title Windows 备份还原小助手(撒手不管版)  作者:王大侠   BY www.cn-dos.net  lotus516 
dir /b /a f:\20*.bf>f:\备份还原.txt
set count=0
setlocal enabledelayedexpansion
for /f %%i in (f:\备份还原.txt) do (
    set /a count+=1
    set first=!second!
    set second=!third!
    set third=%%i
)
:index
cls
echo.
echo.
echo.
echo                                 王大侠精工出品
echo.
echo                                  (撒手不管版)
echo                       ╭───────────────╮
echo                       │                              │
echo                   ╭─┤ Windows 备 份 还 原 小 助 手 ├─╮
echo                   │  │                              │  │
echo                   │  ╰───────────────╯  │
echo                   │   注意本软件仅为你保存最多五个备份   │
echo                   │                                      │
echo                   │            ☆ 操作选项 ☆            │
echo                   │                                      │
echo                   │    1.系统备份  2.系统还原  3.退出    │
echo                   ╰───────────────────╯
echo.
set start=
set /p start=    输入(1 2 3)后按回车键:
if "%start%"=="1" goto bf
if "%start%"=="2" goto hy
if "%start%"=="3" goto :eof
goto index
:bf
if %count% equ 3 attrib -r -s -h f:\%first%&&del f:\%first%
attrib -r -s -h c:\boot.ini
copy c:\ghost\c启动.ini c:\boot.ini
echo cd\>c:\AUTOEXEC.BAT
echo cd ghost>>c:\AUTOEXEC.BAT
echo copy c:\ghost\boot.ini c:\>>c:\AUTOEXEC.BAT
echo Ghost.exe -clone,mode=pdump,src=1:2,dst=1:4\%date:~0,4%%date:~5,2%%date:~8,2%.gho -z9 -sure -rb>>c:\AUTOEXEC.BAT
echo echo.^>c:\AUTOEXEC.BAT>E:\自编程序区\善后.bat
echo attrib.exe +r +s +h c:\boot.ini>>E:\自编程序区\善后.bat
echo ren f:\%date:~0,4%%date:~5,2%%date:~8,2%.gho %date:~0,4%%date:~5,2%%date:~8,2%.bf>>E:\自编程序区\善后.bat
echo attrib +r +s +h f:\%date:~0,4%%date:~5,2%%date:~8,2%.bf>>E:\自编程序区\善后.bat
echo del f:\备份还原.txt>>E:\自编程序区\善后.bat
echo del "C:\Personal\王大侠\「开始」菜单\程序\启动\善后.bat.lnk">>E:\自编程序区\善后.bat
goto end
:hy
set num=
cls
echo.
echo.
echo.
echo                                 王大侠精工出品
echo.
echo                                  (撒手不管版)
echo                       ╭───────────────╮
echo                       │                              │
echo                   ╭─┤ Windows 备 份 还 原 小 助 手 ├─╮
echo                   │  │                              │  │
echo                   │  ╰───────────────╯  │
echo                   │                                      │
echo                   │   注意本软件仅为你保存最多五个备份   │
echo                   │                                      │
echo                   │            ☆ 操作选项 ☆            │
echo                   │                                      │
echo                   │      1. 还  原  原  始  系  统       │
echo                   │      2. 还  原  精  简  系  统       │
if not "!third!"=="" (echo                   │      3.还原为!third:~0,4!年!third:~4,2!月!third:~6,2!日系统      │)else if "!num!"=="" set num=3
if not "!second!"=="" (echo                   │      4.还原为!second:~0,4!年!second:~4,2!月!second:~6,2!日系统      │)else if "!num!"=="" set num=4
if not "!first!"=="" (echo                   │      5.还原为!first:~0,4!年!first:~4,2!月!first:~6,2!日系统      │)else if "!num!"=="" set num=5
if "!num!"=="" set num=6
echo                   │      !num!. 退                  出       │
echo                   ╰───────────────────╯
echo.
:cl
set start=
set /p start=    输入(1 2 3 4 5 6)后按回车键:
if "%start%"=="!num!" goto :eof
if "%start%"=="1" attrib -r -s -h f:\yuanshiWindows.bf&&set GHO=yuanshiWindows.bf&&goto hyks
if "%start%"=="2" attrib -r -s -h f:\jingjianWindows.bf&&set GHO=jingjianWindows.bf&&goto hyks
if "%start%"=="3" attrib -r -s -h f:\!third:~0,8!.bf&&set GHO=!third:~0,8!.bf&&goto hyks
if "%start%"=="4" attrib -r -s -h f:\!second:~0,8!.bf&&set GHO=!second:~0,8!.bf&&goto hyks
if "%start%"=="5" attrib -r -s -h f:\!first:~0,8!.bf&&set GHO=!first:~0,8!.bf&&goto hyks
goto cl
:hyks
attrib -r -s -h c:\boot.ini
copy c:\ghost\c启动.ini c:\boot.ini
echo cd\>c:\AUTOEXEC.BAT
echo cd ghost>>c:\AUTOEXEC.BAT
echo copy c:\ghost\boot.ini c:\>>c:\AUTOEXEC.BAT
echo Ghost.exe -clone,mode=pload,src=1:4\%GHO%:1,dst=1:2 -sure -rb>>c:\AUTOEXEC.BAT
echo echo.^>c:\AUTOEXEC.BAT>E:\自编程序区\善后.bat
echo attrib.exe +r +s +h c:\boot.ini>>E:\自编程序区\善后.bat
if "%start%"=="1" echo attrib +r +s +h f:\yuanshiWindows.bf>>E:\自编程序区\善后.bat
if "%start%"=="2" echo attrib +r +s +h f:\jingjianWindows.bf>>E:\自编程序区\善后.bat
if "%start%"=="3" echo attrib +r +s +h f:\!third:~0,8!.bf>>E:\自编程序区\善后.bat
if "%start%"=="4" echo attrib +r +s +h f:\!second:~0,8!.bf>>E:\自编程序区\善后.bat
if "%start%"=="5" echo attrib +r +s +h f:\!first:~0,8!.bf>>E:\自编程序区\善后.bat
echo del f:\备份还原.txt>>E:\自编程序区\善后.bat
echo del "C:\Personal\王大侠\「开始」菜单\程序\启动\善后.bat.lnk">>E:\自编程序区\善后.bat
goto end
:end
copy E:\自编程序区\善后.bat.lnk "C:\Personal\王大侠\「开始」菜单\程序\启动\">nul
shutdown -r -t 1
本程序用于有DOS系统的双启动机,或grub虚拟的DOS机(虚拟的要自已改好多),善后快捷链接为提前生成的,我对程序生能的快捷链接不爽,具体情况自己改!boot也是提前改好了的,一个是自动以xp为默认启动,一个是以DOS为默认启动!
 Last edited by lotus516 on 2010-1-7 at 13:08 ]