|
yhzlt2008
新手上路

积分 19
发帖 9
注册 2007-1-8
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
@echo off
set drv=c d e f g h i j k l m n o p q r s t u v w x y z
if "%1"=="" if "%last_drv%"=="" call %0 %drv%
:set_last
if "%1"=="" goto end
md %1:\last.drv>nul
if not exist %1:\last.drv\nul goto end
rd %1:\last.drv>nul
set last_drv=%1:
shift
goto set_last
:end
这个批处理这样写对吗? 
@echo off
set drv=c d e f g h i j k l m n o p q r s t u v w x y z
if "%1"=="" if "%last_drv%"=="" call %0 %drv%
:set_last
if "%1"=="" goto end
md %1:\last.drv>nul
if not exist %1:\last.drv\nul goto end
rd %1:\last.drv>nul
set last_drv=%1:
shift
goto set_last
:end
Is this batch script written correctly? :cool:
|
|
2007-1-31 05:36 |
|
|
lizaoyou
中级用户
  
积分 210
发帖 85
注册 2007-1-14 来自 广东广州
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
无光驱等时,应该可以通过,说点看法:
1. md 行的 >nul 似乎不起作用,因为若盘符有效,md 是不产生信息的,若盘符无效,>nul 又不能屏蔽错误信息。
2. 通过建临时目录的方法进行判断似嫌多余,可将 if not ... 行简化为 if not exist %1:\nul goto end,并删除前后两行(md、rd 行),同样可达到目的。
3. 镜像要ghost到最后一个分区,还需将盘符转为数字。
Last edited by lizaoyou on 2007-1-30 at 09:47 PM ]
When there is no CD - ROM and so on, the following views can be made:
1. The >nul in the md line seems not to work, because if the drive letter is valid, md does not produce information, and if the drive letter is invalid, >nul cannot shield the error message.
2. The method of building a temporary directory for judgment seems redundant. The if not... line can be simplified to if not exist %1:\nul goto end, and the previous two lines (md and rd lines) can be deleted, and the same purpose can be achieved.
3. To ghost the image to the last partition, the drive letter needs to be converted to a number.
Last edited by lizaoyou on 2007-1-30 at 09:47 PM ]
|
|
2007-1-31 10:33 |
|
|
hnlyzhd
高级用户
   
积分 544
发帖 164
注册 2004-10-17
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
我把用的贴出来大伙看看
判断最后分区并分配变量:
===========================
CLS
:1
FIND /I "%P%:%1" GHSTSTAT.TXT >NUL
IF ERRORLEVEL 1 GOTO 2
SET IMAGEDRV=%P%:%1
GOTO 1
:2
==============================================
利用GHSOT对目标区进行备份恢复
ghost -dd >NUL
set p=1
call FINDDRV.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14
ghost -clone,mode=pdump,src=1:1,dst=%imagedrv%:\System.gho -z5 -fx -sure
===================================
我的一键恢复下载:
下载地址:
网通:
http://www.yjwb.net/sysoft/onekey.rar
电信:
ftp://sysoft:sysoft@219.150.11.34/onekey.rar
I post what I used for everyone to see
Judge the last partition and assign variables:
===========================
CLS
:1
FIND /I "%P%:%1" GHSTSTAT.TXT >NUL
IF ERRORLEVEL 1 GOTO 2
SET IMAGEDRV=%P%:%1
GOTO 1
:2
==============================================
Use GHSOT to backup and restore the target area
ghost -dd >NUL
set p=1
call FINDDRV.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14
ghost -clone,mode=pdump,src=1:1,dst=%imagedrv%:\System.gho -z5 -fx -sure
=================================
My one-key recovery download:
Download address:
Netcom:
http://www.yjwb.net/sysoft/onekey.rar
Telecom:
ftp://sysoft:sysoft@219.150.11.34/onekey.rar
|

我的留言簿
http://hnlyzhd.ys168.com 我的网络盘
|
|
2007-1-31 10:42 |
|
|
yhzlt2008
新手上路

积分 19
发帖 9
注册 2007-1-8
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
Originally posted by hnlyzhd at 2007-1-30 09:42 PM:
我把用的贴出来大伙看看
判断最后分区并分配变量:
===========================
CLS
:1
FIND /I "%P%:%1" GHSTSTAT.TXT >NUL
IF ERRORLEVEL 1 GOTO 2
SET IMAGE ...
<img src="images/smilies/face-surprise.png" align="absmiddle" border="0">楼上的能把你的批处理解释一下吗?<img src="images/smilies/face-grin.png" align="absmiddle" border="0">
Originally posted by hnlyzhd at 2007-1-30 09:42 PM:
I'll post what I used for everyone to take a look
Judge the last partition and assign variables:
===========================
CLS
:1
FIND /I "%P%:%1" GHSTSTAT.TXT >NUL
IF ERRORLEVEL 1 GOTO 2
SET IMAGE ...
:oCan the person above explain your batch script for me? :lol:
|
|
2007-2-1 12:27 |
|
|
hnlyzhd
高级用户
   
积分 544
发帖 164
注册 2004-10-17
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
用GHOST -DD生成SHSTSTAT.TXT,然后用FIND命令寻找1:1,1:2等字符,找到最大值,就把这个设置为变量IMAGEDRV,这个就是最后分区的盘符了!
然后用GHOST命令行参数自动备份恢复就OK!
Generate SHSTSTAT.TXT using GHOST -DD, then use the FIND command to find characters like 1:1, 1:2, etc. Find the maximum value and set it as the variable IMAGEDRV, which is the drive letter of the last partition! Then use the GHOST command-line parameters for automatic backup and recovery, and it's done!
|

我的留言簿
http://hnlyzhd.ys168.com 我的网络盘
|
|
2007-2-1 20:52 |
|
|
jiaju8
初级用户
 
积分 74
发帖 30
注册 2007-3-9
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
hnlyzhd 你的支持多硬盘吗
Does hnlyzhd support multiple hard drives?
|
|
2007-3-12 20:27 |
|
|
axi
中级用户
   脚本爱好者
积分 238
发帖 93
注册 2007-3-11 来自 GZ
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
以下方法适合NTFS和FAT32混合的情形:
其中 %hdd%为硬盘数(不超过2个,可以增加检测 "key 3" 行能检测出存在3个硬盘...),%partn%为分区数(不超过9个)
set hdd=
set partn=
ghost.exe -dd >nul
find "Key 2" ghststat.txt >nul
if errorlevel 1 set "hdd=1" && goto 0pt
set hdd=2
rem 把存在 Key 1 的行数保存到 part.txt 中(表示第1硬盘存在的分区数,可以通过对 Key 2 的行数检测,能得到第2硬盘分区数)
find "Key 1" /c ghststat.txt >part.txt
:0pt
find "0" part.txt >nul
if errorlevel 1 goto 1pt
set partn=0
goto checkok
:1pt
find "1" part.txt >nul
if errorlevel 1 goto 2pt
set partn=1
goto checkok
:2pt
find "2" part.txt >nul
if errorlevel 1 goto 3pt
set partn=2
goto checkok
:3pt
find "3" part.txt >nul
if errorlevel 1 goto 4pt
set partn=3
goto checkok
:4pt
find "4" part.txt >nul
if errorlevel 1 goto 5pt
set partn=4
goto checkok
:5pt
find "5" part.txt >nul
if errorlevel 1 goto 6pt
set partn=5
goto checkok
:6pt
find "6" part.txt >nul
if errorlevel 1 goto 7pt
set partn=6
goto checkok
:7pt
find "7" part.txt >nul
if errorlevel 1 goto 8pt
set partn=7
goto checkok
:8pt
find "8" part.txt >nul
if errorlevel 1 goto 9pt
set partn=8
goto checkok
:9pt
find "9" part.txt >nul
if errorlevel 1 goto err
set partn=9
goto checkok
:err
set partn=?
:checkok
del ghststat.txt
del part.txt
ghost -z3 -sure -fx -fro -auto -clone,mode=pdump,src=1:1,dst=1:%partn%\SYSC.GHO
Last edited by axi on 2007-3-13 at 01:34 PM ]
The following methods are suitable for the case of mixing NTFS and FAT32:
Among them, %hdd% is the number of hard drives (no more than 2, and detecting the line "key 3" can detect that there are 3 hard drives...), %partn% is the number of partitions (no more than 9)
set hdd=
set partn=
ghost.exe -dd >nul
find "Key 2" ghststat.txt >nul
if errorlevel 1 set "hdd=1" && goto 0pt
set hdd=2
rem Save the number of lines where "Key 1" exists to part.txt (indicating the number of partitions on the first hard drive, and the number of partitions on the second hard drive can be obtained by detecting the number of lines of "Key 2")
find "Key 1" /c ghststat.txt >part.txt
:0pt
find "0" part.txt >nul
if errorlevel 1 goto 1pt
set partn=0
goto checkok
:1pt
find "1" part.txt >nul
if errorlevel 1 goto 2pt
set partn=1
goto checkok
:2pt
find "2" part.txt >nul
if errorlevel 1 goto 3pt
set partn=2
goto checkok
:3pt
find "3" part.txt >nul
if errorlevel 1 goto 4pt
set partn=3
goto checkok
:4pt
find "4" part.txt >nul
if errorlevel 1 goto 5pt
set partn=4
goto checkok
:5pt
find "5" part.txt >nul
if errorlevel 1 goto 6pt
set partn=5
goto checkok
:6pt
find "6" part.txt >nul
if errorlevel 1 goto 7pt
set partn=6
goto checkok
:7pt
find "7" part.txt >nul
if errorlevel 1 goto 8pt
set partn=7
goto checkok
:8pt
find "8" part.txt >nul
if errorlevel 1 goto 9pt
set partn=8
goto checkok
:9pt
find "9" part.txt >nul
if errorlevel 1 goto err
set partn=9
goto checkok
:err
set partn=?
:checkok
del ghststat.txt
del part.txt
ghost -z3 -sure -fx -fro -auto -clone,mode=pdump,src=1:1,dst=1:%partn%\SYSC.GHO
Last edited by axi on 2007-3-13 at 01:34 PM ]
|
|
2007-3-14 01:59 |
|
|
zzoym
初级用户
 
积分 56
发帖 13
注册 2006-11-19
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
ghost11 -dd >NUL
set p=1
call flast.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14
GHOST11.EXE -CLONE,MODE=PLOAD,SRC=%LastP%\SYSBAK.BBS:1,DST=1:1 -sure -FX -RB
flast.bat
:1
FIND /i "%p%:%1" GHSTSTAT.TXT >NUL
if errorlevel 1 goto 2
set LastP=%p%:%1
Shift
goto 1
:2
:del GHSTSTAT.TXT
ghost11 -dd >NUL
set p=1
call flast.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14
GHOST11.EXE -CLONE,MODE=PLOAD,SRC=%LastP%\SYSBAK.BBS:1,DST=1:1 -sure -FX -RB
flast.bat
:1
FIND /i "%p%:%1" GHSTSTAT.TXT >NUL
if errorlevel 1 goto 2
set LastP=%p%:%1
Shift
goto 1
:2
:del GHSTSTAT.TXT
|
|
2007-3-14 05:08 |
|
|
jiaju8
初级用户
 
积分 74
发帖 30
注册 2007-3-9
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
zzoym:
你这个能解释下吗
Last edited by jiaju8 on 2007-3-13 at 04:16 PM ]
zzoym:
Can you explain this?
Last edited by jiaju8 on 2007-3-13 at 04:16 PM ]
|
|
2007-3-14 05:14 |
|
|
cfenjin
新手上路

积分 2
发帖 1
注册 2009-12-10
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
能不能写一个完整的,让ghost把镜像备份到最后一个分区的批处理。
Can you write a complete batch script that makes Ghost back up the image to the last partition?
|
|
2009-12-11 10:22 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
Originally posted by cfenjin at 2009-12-11 10:22:
能不能写一个完整的,让ghost把镜像备份到最后一个分区的批处理。
完整的,就到现成的一键恢复工具里去找。
不少一键恢复都是自动备份到最后分区的。
Originally posted by cfenjin at 2009-12-11 10:22:
Can you write a complete batch script that makes Ghost back up the image to the last partition?
Complete ones can be found in ready-made one-click recovery tools.
Many one-click recoveries automatically back up to the last partition.
|

Windows 一键还原
http://www.yjhy.com |
|
2009-12-22 10:40 |
|
|
DXSX
中级用户
  
积分 247
发帖 147
注册 2009-4-9
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
http://bbs.wuyou.com/viewthread.php?tid=138340&extra=page%3D1&page=1
用awk 一句话就可以搞定
大概应该是:
gdisk 1|awk '/PRIMARY/;/LOGICA/' |AWK 'END {printf "ghost -clone,mode pdump,src=1:1,dst=1:"FNR":";printf "%%c",92;printf "System.gho -z5 -fx -sure"}'>G.BAT
得到的 G.BAT 就是你所需要的脚本。
就是用awk 分析gdisk 得到的第一硬盘分区信息获得分区总个数,并生成对应的备份脚本g.bat。
需要gdisk 和awk
Last edited by DXSX on 2009-12-23 at 19:35 ]
http://bbs.wuyou.com/viewthread.php?tid=138340&extra=page%3D1&page=1
It can be done in one sentence with awk.
Probably like this:
gdisk 1|awk '/PRIMARY/;/LOGICA/' |AWK 'END {printf "ghost -clone,mode pdump,src=1:1,dst=1:"FNR":";printf "%%c",92;printf "System.gho -z5 -fx -sure"}'>G.BAT
The obtained G.BAT is the script you need.
That is, use awk to analyze the partition information of the first hard disk obtained by gdisk to obtain the total number of partitions and generate the corresponding backup script g.bat.
gdisk and awk are needed
Last edited by DXSX on 2009-12-23 at 19:35 ]
附件
1: awk.rar (2009-12-23 18:37, 43.01 KiB,下载次数: 21)
|
|
2009-12-23 18:31 |
|
|
xsdxb
新手上路

积分 8
发帖 4
注册 2010-9-13
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
我有一个,看看行不行
@echo off
XMSDSK 6144 /Y >nul
FINDRAMD >NUL
MD %RAMDRIVE%\TEMP
SET TMP=%RAMDRIVE%\TEMP
SET TEMP=%RAMDRIVE%\TEMP
COPY COMMAND.COM %RAMDRIVE%\ >NUL
PATH=%RAMDRIVE%\;%PATH%
SET COMSPEC=%RAMDRIVE%\COMMAND.COM
copy /y A:\ghost.exe %RAMDRIVE%\ >NUL
copy /y a:\finddrv.bat %RAMDRIVE%\ >NUL
copy /y a:\find.com %RAMDRIVE%\ >NUL
copy /y a:\restart.com %RAMDRIVE%\ >NUL
@cls
@echo.
@echo △△[Ghost自动备份]
@echo.
@echo 将第 1 块硬盘的第 1 分区(C盘) 备份到最后分区\Ghost\GhostXP.gho
@echo.
@echo 注意! 最后分区中如果存有同名镜像文件将被覆盖。
@echo.
@echo 压缩率:高等压缩
@echo.
@echo.
@A:\CHOICE 要继续吗?请选择是(Y)或否(N)
@If errorlevel 1 if not errorlevel 2 goto HF
@if errorlevel 2 if not errorlevel 3 goto Show
:HF
%RAMDRIVE%\
ghost -dd >NUL
set p=1
call FINDDRV.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14
ghost -clone,mode=pdump,src=1:1,dst=%imagedrv%:\ghost\GHOSTXP.GHO -z5 -sure -rb
@if errorlevel 2 if not errorlevel 3 goto Show
:Show
@echo.
@echo.
@echo.
@echo 同时按下Ctrl + Alt + Del三个键后重新启动计算机!
I have one, let's see if it works
@echo off
XMSDSK 6144 /Y >nul
FINDRAMD >NUL
MD %RAMDRIVE%\TEMP
SET TMP=%RAMDRIVE%\TEMP
SET TEMP=%RAMDRIVE%\TEMP
COPY COMMAND.COM %RAMDRIVE%\ >NUL
PATH=%RAMDRIVE%\;%PATH%
SET COMSPEC=%RAMDRIVE%\COMMAND.COM
copy /y A:\ghost.exe %RAMDRIVE%\ >NUL
copy /y a:\finddrv.bat %RAMDRIVE%\ >NUL
copy /y a:\find.com %RAMDRIVE%\ >NUL
copy /y a:\restart.com %RAMDRIVE%\ >NUL
@cls
@echo.
@echo △△
@echo.
@echo Back up partition 1 (C drive) of the first hard disk to the last partition\Ghost\GhostXP.gho
@echo.
@echo Attention! If there is a mirror file with the same name in the last partition, it will be overwritten.
@echo.
@echo Compression ratio: High compression
@echo.
@echo.
@A:\CHOICE Do you want to continue? Please choose Y or N
@If errorlevel 1 if not errorlevel 2 goto HF
@if errorlevel 2 if not errorlevel 3 goto Show
:HF
%RAMDRIVE%\
ghost -dd >NUL
set p=1
call FINDDRV.bat 1 2 3 4 5 6 7 8 9 10 11 12 13 14
ghost -clone,mode=pdump,src=1:1,dst=%imagedrv%:\ghost\GHOSTXP.GHO -z5 -sure -rb
@if errorlevel 2 if not errorlevel 3 goto Show
:Show
@echo.
@echo.
@echo.
@echo Press Ctrl + Alt + Del three keys at the same time and then restart the computer!
|
|
2010-9-16 22:18 |
|
|
t9v10
新手上路

积分 6
发帖 3
注册 2010-7-27
状态 离线
|
|
2010-9-26 15:41 |
|