China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-13 20:12
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Autoexec.bat automatic search function??? View 1,819 Replies 10
Original Poster Posted 2004-08-07 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 123
Posts 8
Joined 2004-08-07 00:00
22-year member
UID 29808
Gender Male
Status Offline
I have a question? I want to ask everyone, I'm waiting online.
I want to make a GHOST recovery disc for a friend. The GHOST backup file is placed on the hard drive (the directory is not necessarily fixed), and only the boot information is made on the disc. The specific use of the boot information on the disc:
After the disc is booted, we just need to press the Y key on the keyboard to call the GHOST backup file on the hard drive to restore it. But the problem is here. The GHOST backup files of my friends are placed in different locations. Some are placed in the E:\GHOST directory, some are placed in the F:\GHOST directory. Some are placed in other directories.请问Is there any way to add a few statements in autoexec.bat to automatically search for the location of the GHOST backup file. Then start the recovery.

Thank you everyone here!
Floor 2 Posted 2004-08-12 00:00 ·  中国 河南 安阳 联通
银牌会员
★★★
Credits 1,186
Posts 334
Joined 2003-05-30 00:00
23-year member
UID 2626
Gender Male
Status Offline
There are many methods to implement. I also changed such batch files before. I provide an idea. Use choice to set the drive letter, then use dir to locate the location of the ghost backup, then tell the location to the environment variable. The ghost command statement uses variables for the restore operation. One small program lmod.com is used, which can be found by searching in the forum. A good deed is done to the end, and I will upload it to you.

The choice -related statements are omitted.

cd\
diir *.gho /s/b|lmod set gho=
ghost.exe -sure -rb -clone,mode=pload,src=%gho%:1,dst=1:1

Floor 3 Posted 2004-08-12 00:00 ·  中国 河南 安阳 联通
银牌会员
★★★
Credits 1,186
Posts 334
Joined 2003-05-30 00:00
23-year member
UID 2626
Gender Male
Status Offline
Upload failed, you first search for lmod, and then talk about it if you can't find it
Floor 4 Posted 2004-10-20 00:00 ·  中国 河南 南阳 联通
初级用户
Credits 131
Posts 6
Joined 2004-06-25 00:00
22-year member
UID 27340
Gender Male
Status Offline
What exactly is lmod?
Floor 5 Posted 2004-10-25 00:00 ·  中国 福建 泉州 石狮市 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
Isn't using LOCATE.COM okay?
QQ:366840202
http://chenall.net
Floor 6 Posted 2006-09-03 10:46 ·  中国 河南 商丘 中移铁通
初级用户
Credits 74
Posts 21
Joined 2006-08-09 23:15
20-year member
UID 60186
Status Offline
If there are more than one .gho files under a partition, the method of Dragon King diir *.gho /s/b|lmod set gho= can only set the first found file, and this may not be the file to be used? How to continue searching?

[ Last edited by hujintao on 2006-9-3 at 10:48 ]
Floor 7 Posted 2006-09-03 21:58 ·  中国 广东 东莞 电信
初级用户
我不入地狱谁入地狱
Credits 20
Posts 8
Joined 2006-08-26 15:48
19-year member
UID 61321
Gender Male
Status Offline
Reply: The `*.gho above represents finding all GHOST backup files. Why can't you replace * with the specific one you want to find?
Floor 8 Posted 2006-09-03 21:58 ·  中国 广东 东莞 电信
初级用户
我不入地狱谁入地狱
Credits 20
Posts 8
Joined 2006-08-26 15:48
19-year member
UID 61321
Gender Male
Status Offline
Is it "diir"? Did you type one extra "i"?
Floor 9 Posted 2006-09-03 22:00 ·  中国 广东 东莞 电信
初级用户
我不入地狱谁入地狱
Credits 20
Posts 8
Joined 2006-08-26 15:48
19-year member
UID 61321
Gender Male
Status Offline
And that dir cannot search the entire disk. Oh, you also need to type c: d: e: f: and so on...
Floor 10 Posted 2006-09-05 04:10 ·  中国 河南 商丘 中移铁通
初级用户
Credits 74
Posts 21
Joined 2006-08-09 23:15
20-year member
UID 60186
Status Offline
Then how to continue searching to find the GHO file you want
Floor 11 Posted 2006-09-08 06:15 ·  中国 安徽 宿州 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
Can we first set a variable: first let's choose the drive letter where the .Gho file is located, then use Dir x:\*.gho/s/a to search. After finding it, then use Ghost to automatically restore.
Forum Jump: