以下有两段批处理,分别为GHOBT.bat 和 GHOBT2.bat ,利用GHOST进行一键还原使用,先是在所有驱动器上都建立一下 MSGHOST 文件夹,然后判断GHOST在哪个文件夹下生成了映像文件,最后把其他驱动器上的空MSGHOST 目录删除,但是经测试,以下脚本会将所有的 MSGHOST 文件夹删除。。。。请问各位大侠,如何修改才能达到目的???
GHOBT.bat- @ECHO OFF
- SET GhoDRV=%1
- attrib -h -r -s %GhoDRV%:\msghost>nul
- if not exist %GhoDRV%:\msghost\msgho.ini goto ghost3
- strings o=read %GhoDRV%:\msghost\msgho.ini,1
- strings p=read %GhoDRV%:\msghost\msgho.ini,2
- strings q=right %o%,3
- strings r=right %p%,3
- set partd=%r%
- attrib +h +r +s %GhoDRV%:\msghost>nul
- xmsman -c>nul
- ghost.exe -clone,mode=pdump,src=%sys%,dst=%partd%:\msghost\msghost.smy -fx -sure -z3 -nousb %noide%
- goto EXIT
-
- :ghost3
- for %%v in (%Drv%) do md %%v:\msghost>nul
- xmsman -c>nul
- ghost.exe -clone,mode=pdump,src=%sys%,dst=%partd%:\msghost\msghost.smy -fx -sure -z3 -nousb %noide%
- goto ximen
-
- :ximen
- call NTFS.bat
- for %%h in (%Drv%) do if exist %%h:\msghost\msghost.smy GHOBF2 %%h
- goto EXIT
- :EXIT
复制代码 ______________________________________________________________
GHOBT2.bat- @ECHO OFF
- set k=%1
- attrib -h -r -s %k%:\msghost>nul
- echo system=%sys%>%k%:\msghost\msgho.ini
- echo gho=%partd%>>%k%:\msghost\msgho.ini
- echo.>>%k%:\msghost\msgho.ini
- echo.>>%k%:\msghost\msgho.ini
- echo 请勿删除此文件,否则恢复程序无法运行!>>%k%:\msghost\msgho.ini
- attrib +h +r +s %k%:\msghost>nul
- for %%y in (%Drv%) do rd %%y:\msghost>nul
- xmsman -c>nul
- exit
复制代码
|