来到DOS联盟的第一帖啊!
希望大家帮助我啊!
我知道很多的一键还原软件的工作原理!
但是,很想知道如果用BAT去实现它的功能啊!
希望有达人帮我一下!
希望大家帮助我啊!
我知道很多的一键还原软件的工作原理!
但是,很想知道如果用BAT去实现它的功能啊!
希望有达人帮我一下!
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by siyeyuexin at 2010-1-6 12:25 PM:
本人比较笨!请楼主指明!

@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 1Originally posted by lianjiang2004 at 2010-1-7 18:19:
个人以为,6楼的一键恢复,通用性稍微差了些。
Originally posted by lotus516 at 2010-1-7 18:47:
呵呵,LZ要的是bat的,那我就搞个BAT的,不过,我可没大侠那么强,通用性嘛,只是给我装的电脑上,没有搞外流,呵呵,献丑了!
Originally posted by lianjiang2004 at 2010-1-7 18:19:
个人以为,6楼的一键恢复,通用性稍微差了些。
Originally posted by lianjiang2004 at 2010-1-7 20:22:
假如是自己用的话,只需要根据6楼的现成批处理,相应的参数改成自己就可以了。
不需要完全看懂,只要关键的参数能知道改就够了。
假如是制作 ...
Originally posted by siyeyuexin at 2010-1-7 19:46:
谢谢六楼的这位达人!
不过当中有一些不懂!
不知道我可以加大侠?
我们详聊可以吗?
412170763!