|
haiou327
高级用户
DOS时空
积分 713
发帖 348
注册 2007-2-10
状态 离线
|
『楼 主』:
遍厉所有分区下GHO文件并还原
遍厉所有分区下GHO文件并还原的批处理.
要能支持畸形目录..\之类的.
|
欢迎进入我的网盘!!! |
|
2007-11-24 01:52 |
|
|
haiou327
高级用户
DOS时空
积分 713
发帖 348
注册 2007-2-10
状态 离线
|
|
2007-11-26 19:44 |
|
|
fastslz
铂金会员
DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第
3 楼』:
楼主说的是纯DOS下遍历吧,说白了纯DOS下这种技术一般没人帮的。你可以参考其他一键ghost类的工具代码。
|
第一高手 第二高手
我的小站
|
|
2007-11-26 21:53 |
|
|
xiaoyunwang
高级用户
积分 939
发帖 374
注册 2007-10-17 来自 湖南张家界
状态 离线
|
『第
4 楼』:
我来回复吧
@echo off
if %1#==?# goto usage
if %1#==/?# goto usage
if %1#==-?# goto usage
if %1#==/h# goto usage
if %1#==/H# goto usage
if %1#==/help# goto usage
if %1#==/HELP# goto usage
for %%a in (h H -H -h help HELP -help -HELP) do if %%a#==%1# goto usage
if not %1#==# goto begin
echo 此处添加视窗操作界面,略过!自己加,我用的是字典文件!
:begin
set searchfolder=
set object=
set object=%1
for %%a in (r R) do if %2#==-%%a# set searchfolder=Yes
for %%a in (folder result search) do if exist %temp%\%%a.txt del %temp%\%%a.txt
echo 搜索范围:所有存在驱动器的根目录和一级目录>%temp%\search.txt
echo 搜索对象:%1>>%temp%\search.txt
echo 搜索路径:>>%temp%\search.txt
echo.>>%temp%\search.txt
echo.>>%temp%\search.txt
echo.>>%temp%\search.txt
wbat fill23,10(1,62)(white on +black) " "
wbat fill24,10(1,62)(white on +black) " "
wbat fill16,10(7,62)(white on +black) " " !text17,10@%temp%\search.txt
wbat text21,16(1,50)(+white on black) "[ ]"
func -a6 >%temp%\drv.txt
strings linage=linesize %temp%\drv.txt
strings drv=read %temp%\drv.txt,1
if %drv%#==# goto end
strings linage=add %linage%,1
set number=0
:cycle
if %number%#==%linage%# goto next
strings number=add %number%,1
strings drv=read %temp%\drv.txt,%number%
if %drv%#==# goto cycle
dready %drv%: /w |if errorlevel 2 goto cycle
echo %drv%:>>%temp%\folder.txt
if %searchfolder%#==# goto cycle
dir "%drv%:" /ad/b>%temp%\path.txt
strings linepath=read %temp%\path.txt,1
if %linepath%#==# goto cycle
strings linepath=linesize %temp%\path.txt
strings linepath=add %linepath%,1
set pathnum=0
:pcycle
if %pathnum%#==%linepath%# goto cycle
strings pathnum=add %pathnum%,1
strings folder=read %temp%\path.txt,%pathnum%
if %folder%#==# goto pcycle
echo %drv%:\%folder%>>%temp%\folder.txt
goto pcycle
:next
for %%a in (searchfolder linage drv number linepath pathnum folder) do set %%a=
strings linage=linesize %temp%\folder.txt
strings linage=add %linage%,1
calc387 49 / %linage%>%temp%\norm.txt
strings norm=read %temp%\norm.txt,1
set guage=1
set number=0
:search
if %number%#==%linage%# goto end
strings number=add %number%,1
strings location=read %temp%\folder.txt,%number%
if %location%#==# goto search
dir "%location%\%object%" /a/b >%temp%\file.txt
strings filenum=read %temp%\file.txt,1
if %filenum%#==# goto guage
strings filenum=linesize %temp%\file.txt
strings filenum=add %filenum%,1
set num=0
echo :search "搜索结果列表" [x] >%temp%\result.txt
:file
if %num%#==%filenum%# goto guage
strings num=add %num%,1
strings file=read %temp%\file.txt,%num%
if %file%#==# goto file
set wz=0
set filesize=
set filedate=
strings filesize=filesize %location%\%file%|if errorlevel 1 goto result
strings filedate=filedate %location%\%file%>nul
strings filesize=div %filesize%,1024
if %filesize%#==0# set filesize=1
strings length=length %filesize%
set div=%filesize%
:div
strings div=div %div%,1024
if not %div%#==0# strings wz=add %wz%,1
if not %div%#==0# goto div
strings wz=add %length%,%wz%
strings wz=sub 38,%wz%
strings filesize=addcommas %filesize%
set filesize=%filesize%KB
:result
set name=%location%\%file%
if not %wz%#==0# strings name=left %name%,%wz%
echo %name% %filesize% %filedate%>>%temp%\result.txt
wbat fill23,10(1,62)(white on +black) " " !text23,15 "%name% %filesize% %filedate%"
goto file
:guage
calc387 %guage% + %norm%>%temp%\norm.txt
strings guage=read %temp%\norm.txt,1
strings _dot=filename %guage%
calc387 %guage% * 2 - 1>%temp%\norm.txt
strings percent=read %temp%\norm.txt,1
strings percent=filename %percent%
wbat fill19,26(1,40)(white on +black) " " !text19,26(1,40) "%location%"
wbat fill21,16(1,%_dot%)(white on blue) !text21,39(1,2) "%percent%%%"
goto search
:end
wbat fill21,16(1,50)(white on blue) !text21,39(1,2) "100%%"
for %%a in (gho GHO iso ISO) do if %1#==*.%%a# if exist %temp%\result.txt copy %temp%\result.txt %temp%\%%a.ini /y >nul
for %%a in (drv folder path file norm) do if exist %temp%\%%a.txt del %temp%\%%a.txt
for %%a in (menu me) do if exist %temp%\%%a.bak del %temp%\%%a.bak
for %%a in (linage norm guage number location num file filenum object _dot percent filesize filedate wz length div name) do set %%a=
goto exit
:usage
wbat pal ! cls ! text 24,4 @%ramd%\dic.txt:copyright
echo.
echo ======================= 智能 %0 搜索引擎 ==========================
echo.
echo %0 [要搜索的文件名] [-r]
echo.
echo 不使用参数 -r 将搜索所有驱动器的根目录
echo 使用参数 -r 将搜索所有驱动器的根目录和一级目录
echo.
echo 实例:
echo %0 *.gho -r 搜索所有驱动器根目录和一级目录的扩展名为.gho的镜像文件
echo %0 *iso* -r 搜索所有驱动器根目录和一级目录的包含关键字为iso的文件
echo 注意通配符 ? 代表任一个字符 , 而 * 代表任多个字符组成的字符串
echo.
echo 以上所有的搜索结果都保存到 %ramd%\temp\result.txt 文件中供调用
echo.
echo --------------- 制作:王小云 结合深度技术论坛(bbs.deepin.org)稍加修改
:exit
|
|
2007-11-28 23:52 |
|
|
jh1688
中级用户
积分 248
发帖 126
注册 2008-5-30
状态 离线
|
『第
5 楼』:
set drv=C D E F G H I J K
for %%i in (%drv%) do dir /a-d /b /s %%i:\*.gho >nul >>temp.txt
find /i ".gho" temp.txt >nul
type temp.txt | lmod set lastdrv=[] >> temp.bat
call temp.bat >nul
Ghost -clone,mode=pload,src=%lastdrv%:1,dst=1:1 -sure -fx
|
|
2008-8-8 05:08 |
|
|
lianjiang2004
金牌会员
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
|
2008-8-8 16:34 |
|
|
liumingqing
初级用户
积分 136
发帖 73
注册 2007-4-2
状态 离线
|
『第
7 楼』:
正需要這方面的資料呢!謝謝4樓5樓的朋友,借我參考一下.
|
|
2008-8-8 17:27 |
|
|