Suppose you originally made GHOST backups on drives D, E, F... Z, but then forgot on which drives, but you just want to find the first backup and update it once and be done.
Suppose the command to update the backup is like this:
@echo off
Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=WIN.gho -Z9 -sure -fx
bfyz.bat
If you find how many, just handle how many, as follows:
Suitable for 2000, XP, 2003:
@echo off
for %%1 in (d e f ....z) do Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=%%1:\WIN.gho -Z9 -sure -fx && bfyz.bat
Suitable for 98:
(Unfortunately, now I can only separate the ghost...... and the two tasks of bfyz.bat. In 98, I haven't found a way to put these two tasks together. If someone can solve it, hurry up and post it in the post bar!!
@echo off
for %%1 in (d e f ....z) do Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=%%1:\WIN.gho -Z9 -sure -fx
for %%1 in (d e f ....z) do if exist %%1:\win.gho bfyz.bat
If it is to find the first one and finish processing it, it is as follows:
@echo off
for %%1 in (z y x ....... d) do if exist %%1:\win.gho set vol=%%1
Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=%vol%:\WIN.gho -Z9 -sure -fx
bfyz.bat
======================================
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
& &
& If you are interested, you can have fun with DIY by manually entering actual parameters! &
& &
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
You can compile a simple batch processing to experiment. First, create files with contents "dddddddddddddddddddddd" and "eeeeeeeeeeeeeeeeeeeeee" respectively in the root directories of your last two drives, both named "target.txt".
======================
Compile a batch processing named "oneput.bat" as follows:
(One-time manual input)
@echo off
:loop
shift
if %1#==# goto end
if not exist %1:\target.txt goto loop
dir %1:\target.txt
type %1:\target.txt
:end
When operating, type
oneput d d e f g h i j k l m n o p q r s t u v w x y z and press Enter. (You need to enter one more arbitrary character, because shift will invalidate the first one, which is equivalent to having had a %1 in front of it)
=========================
Then compile a batch processing named "everyput.bat":
(Looks a bit scary! If someone can find a concise way, post it in the post bar! Looking forward to it! ... Seriously depressed about this!)
(Interactive manual input) Actually, this is hypothetical, because generally there are not so many drives, so just compile it according to your number of drives.
@echo off
:loop
if exist %vol%:\target.txt goto end
choice /c:defghijklmnopqrstuvwxyz /t:d,99 enter a drive letter
set vol=z
if errorlevel 23 goto loop
set vol=y
if errorlevel 22 goto loop
set vol=x
if errorlevel 21 goto loop
set vol=w
if errorlevel 20 goto loop
set vol=v
if errorlevel 19 goto loop
set vol=u
if errorlevel 18 goto loop
set vol=t
if errorlevel 17 goto loop
set vol=s
if errorlevel 16 goto loop
set vol=r
if errorlevel 15 goto loop
set vol=q
if errorlevel 14 goto loop
set vol=p
if errorlevel 13 goto loop
set vol=o
if errorlevel 12 goto loop
set vol=n
if errorlevel 11 goto loop
set vol=m
if errorlevel 10 goto loop
set vol=l
if errorlevel 9 goto loop
set vol=k
if errorlevel 8 goto loop
set vol=j
if errorlevel 7 goto loop
set vol=i
if errorlevel 6 goto loop
set vol=h
if errorlevel 5 goto loop
set vol=g
if errorlevel 4 goto loop
set vol=f
if errorlevel 3 goto loop
set vol=e
if errorlevel 2 goto loop
set vol=d
if errorlevel 1 goto loop
:end
dir %vol%:\target.txt
type %vol%:\target.txt
echo It''''s done!
When operating, type:
everyput d and press Enter (each time enter one: d......................z, until "It''''s done! " appears)
Suppose the command to update the backup is like this:
@echo off
Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=WIN.gho -Z9 -sure -fx
bfyz.bat
If you find how many, just handle how many, as follows:
Suitable for 2000, XP, 2003:
@echo off
for %%1 in (d e f ....z) do Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=%%1:\WIN.gho -Z9 -sure -fx && bfyz.bat
Suitable for 98:
(Unfortunately, now I can only separate the ghost...... and the two tasks of bfyz.bat. In 98, I haven't found a way to put these two tasks together. If someone can solve it, hurry up and post it in the post bar!!
@echo off
for %%1 in (d e f ....z) do Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=%%1:\WIN.gho -Z9 -sure -fx
for %%1 in (d e f ....z) do if exist %%1:\win.gho bfyz.bat
If it is to find the first one and finish processing it, it is as follows:
@echo off
for %%1 in (z y x ....... d) do if exist %%1:\win.gho set vol=%%1
Ghost.exe -CLONE,MODE=PDUMP,SRC=1:1,DST=%vol%:\WIN.gho -Z9 -sure -fx
bfyz.bat
======================================
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
& &
& If you are interested, you can have fun with DIY by manually entering actual parameters! &
& &
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
You can compile a simple batch processing to experiment. First, create files with contents "dddddddddddddddddddddd" and "eeeeeeeeeeeeeeeeeeeeee" respectively in the root directories of your last two drives, both named "target.txt".
======================
Compile a batch processing named "oneput.bat" as follows:
(One-time manual input)
@echo off
:loop
shift
if %1#==# goto end
if not exist %1:\target.txt goto loop
dir %1:\target.txt
type %1:\target.txt
:end
When operating, type
oneput d d e f g h i j k l m n o p q r s t u v w x y z and press Enter. (You need to enter one more arbitrary character, because shift will invalidate the first one, which is equivalent to having had a %1 in front of it)
=========================
Then compile a batch processing named "everyput.bat":
(Looks a bit scary! If someone can find a concise way, post it in the post bar! Looking forward to it! ... Seriously depressed about this!)
(Interactive manual input) Actually, this is hypothetical, because generally there are not so many drives, so just compile it according to your number of drives.
@echo off
:loop
if exist %vol%:\target.txt goto end
choice /c:defghijklmnopqrstuvwxyz /t:d,99 enter a drive letter
set vol=z
if errorlevel 23 goto loop
set vol=y
if errorlevel 22 goto loop
set vol=x
if errorlevel 21 goto loop
set vol=w
if errorlevel 20 goto loop
set vol=v
if errorlevel 19 goto loop
set vol=u
if errorlevel 18 goto loop
set vol=t
if errorlevel 17 goto loop
set vol=s
if errorlevel 16 goto loop
set vol=r
if errorlevel 15 goto loop
set vol=q
if errorlevel 14 goto loop
set vol=p
if errorlevel 13 goto loop
set vol=o
if errorlevel 12 goto loop
set vol=n
if errorlevel 11 goto loop
set vol=m
if errorlevel 10 goto loop
set vol=l
if errorlevel 9 goto loop
set vol=k
if errorlevel 8 goto loop
set vol=j
if errorlevel 7 goto loop
set vol=i
if errorlevel 6 goto loop
set vol=h
if errorlevel 5 goto loop
set vol=g
if errorlevel 4 goto loop
set vol=f
if errorlevel 3 goto loop
set vol=e
if errorlevel 2 goto loop
set vol=d
if errorlevel 1 goto loop
:end
dir %vol%:\target.txt
type %vol%:\target.txt
echo It''''s done!
When operating, type:
everyput d and press Enter (each time enter one: d......................z, until "It''''s done! " appears)


