中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-02 09:11
48,037 topics / 350,122 posts / today 0 new / 48,250 members
DOS批处理 & 脚本技术(批处理室) » How to write a batch script for one-click restoration?
Printable Version  1,987 / 14
Floor1 zerostudy Posted 2006-10-19 23:24
中级用户 Posts 98 Credits 266
ghost.exe -clone,mode=pload,src=H:\sys\xp.GHO,dst=1:1 -sure -rb
This is to automatically restore the H drive to the C drive. How to add a menu item named "One - Click Restore" at boot time so that pressing it can execute the above statement to achieve automatic restoration... All partitions are in FAT32 format... Do you need to install a pure DOS..... How to achieve it...

Can someone give a code~~~
Floor2 NaturalJ0 Posted 2006-10-19 23:46
银牌会员 Posts 533 Credits 1,181
There are many people here who have done similar things. You can find a few to download and take a look first?
Floor3 bc12060101 Posted 2006-10-20 04:26
银牌会员 Posts 712 Credits 1,455
Originally posted by zerostudy at 2006-10-19 23:24:
ghost.exe -clone,mode=pload,src=H:\sys\xp.GHO,dst=1:1 -sure -rb
This is to automatically restore the H drive to the C drive. May I ask how to add a menu named..One-click Restore.. at startup, and by pressing it, it can execute the above...

Hehe, it's not a good habit to handle problems rashly. The command ghost of the building owner cannot be executed!
The correct writing is: ghost.exe -clone,mode=pload,src=H:\sys\xp.GHO:1,dst=1:1 -sure -rb
You need to install a DOS system to your hard drive, and specify to call your "restore" batch file in Autoexec.bat. In this way, when booting into dos, you can execute the restore command.
As for the menu at startup, as long as you install dos to the hard drive, there will usually be a new menu added. You can change the menu name at will in boot.ini.
Floor4 sweetdreamlan Posted 2006-10-20 06:23
中级用户 Posts 92 Credits 244
First, use Vfloppy to create a virtual boot. Of course, other methods can also be used.

Then download winimage.
Use winimage to modify the bootdisk.img in Vfloppy.
Export the config.sys file and the autoexec.bat file.

Content of config.sys:
DOS=HIGH,UMB,AUTO

Content of autoexec.bat:
ghost -clone,mode=pload,src=h:\sys\xp.gho:1,dst=1:1 -sure -rb

Then import the modified config.sys and autoexec.bat into bootdisk.img using winimage.
Then use the Vfloppy image file.

Then you can change "Boot from virtual boot floppy" to "System Restore".
Then apply and restart to the option selection screen, select "System Restore", and it will automatically restore.
Floor5 zerostudy Posted 2006-10-20 11:58
中级用户 Posts 98 Credits 266
The two files in Vfloppy have too much content... What are they for? I can't understand... Should I delete all of them..

Content of config.sys
DOS=HIGH,UMB,AUTO

Content of autoexec.bat
ghost -clone,mode=pload,src=h:\sys\xp.gho:1,dst=1:1 -sure -rb
..Just add these....
Now I don't restart yet, I'm downloading something.. I'll try later....
Floor6 不得不爱 Posted 2006-10-21 02:39
超级版主 Posts 2,044 Credits 5,310 From 四川南充
In config.sys, at least write:
DEVICE=HIMEM
DOS=HIGH,UMB,AUTO
Floor7 zerostudy Posted 2006-10-21 03:17
中级用户 Posts 98 Credits 266
Excuse me, moderator.. That ghost file is too large and can't be added in.... Can you send me a large img empty image?.... Can config.sys specify to execute ghost.exe in an external folder?? Is there a simple introduction tutorial for config.sys and autoext.bat?
Floor8 zerostudy Posted 2006-10-21 03:39
中级用户 Posts 98 Credits 266
The content of autoexec.bat

Add an IF statement to make it necessary to enter a password to execute the following ghost.

How to write this if... I looked it up. I don't know what to use to define variables. And what to use to represent keyboard input.....

ghost -clone,mode=pload,src=h:\sys\xp.gho:1,dst=1:1 -sure -rb
Floor9 zerostudy Posted 2006-10-21 04:17
中级用户 Posts 98 Credits 266
config.sys
DEVICE=HIMEM.sys
DOS=HIGH,UMB,AUTO

autoexec.bat
How to add this???
smartdrv.exe
c:
cd dosghost
ghost -clone,mode=pload,src=h:\sys\xp.gho:1,dst=1:1 -sure -rb

p su That works... May I ask how to encrypt here in autoexec.bat? You need to enter a password to proceed???
Floor10 cmyhome Posted 2006-10-21 20:48
初级用户 Posts 30 Credits 74
Originally posted by zerostudy at 2006-10-21 03:17:
Excuse me, moderator.. That ghost file is too large to add... Can you send me a large img empty image?
....Can config.sys execute ghost.exe in an external folder??
Is there any simple...



1. config.sys cannot run ghost.exe; you need to add it in autoexec.bat;
2. The ghost.exe is too large, you can copy it to the hard drive and call it with the path.

I have one I made myself, you can try it. For the restart item in item 4, you can find a DOS restart command yourself.

*******************************************************

@ECHO OFF
TH
ECHO Operating System One - Click Restore
ECHO Please use the number key to select the menu
ECHO.
ECHO 1. Automatically Backup C: Drive
ECHO 2. Automatically Restore C: Drive
ECHO 3. Boot to MS-DOS
ECHO 4. Restart System
ECHO.
ECHO Note: Please back up important data on C: drive before restoring the system
CHOICE /c:1234
IF ERRORLEVEL 4 GOTO RESET
IF ERRORLEVEL 3 GOTO GHO
IF ERRORLEVEL 2 GOTO BAK
IF ERRORLEVEL 1 GOTO DOS
:BAK
TH/Q
CLS
GHOST -CLONE,MODE=PDUMP,SRC=1:1,DST=H:\SYS\SYSTEM.GHO -SURE -Z9 -RB
GOTO END
:GHO
TH/Q
CLS
GHOST -CLONE,MODE=PLOAD,SRC=H:\SYS\SYSTEM.GHO:1,DST=1:1 -SURE -RB
GOTO END
:DOS
TH/Q
CLS
GOTO END
:RESET
TH/Q
CLS
RESET.COM
:END
Floor11 weilong888 Posted 2006-10-21 22:45
银牌会员 Posts 548 Credits 1,270
The order is wrong. It should be 1. Boot to MS-DOS, 2. Automatically back up the C: drive, 3. Automatically restore the C: drive
Floor12 不得不爱 Posted 2006-10-21 23:15
超级版主 Posts 2,044 Credits 5,310 From 四川南充
I'll improve the code on the 10th floor. tH should be tw, right?
@ECHO OFF
path c:\dosghost
tw
ECHO One - key system recovery
ECHO Please use the numeric keys to select the menu
ECHO.
ECHO 1. Automatically back up drive C:
ECHO 2. Automatically restore drive C:
ECHO 3. Boot to MS - DOS
ECHO 4. Restart the system
ECHO.
ECHO Note: Please back up important data on drive C: before restoring the system
CHOICE /c:1234
tw/q
CLS
IF ERRORLEVEL 4 RESET.COM
IF ERRORLEVEL 3 GOTO END
IF ERRORLEVEL 2 GOTO GHO
IF ERRORLEVEL 1 GOTO BAK
:BAK
GHOST -CLONE,MODE=PDUMP,SRC=1:1,DST=H:\SYS\SYSTEM.GHO -SURE -Z9 -RB
GOTO END
:GHO
GHOST -CLONE,MODE=PLOAD,SRC=H:\SYS\SYSTEM.GHO:1,DST=1:1 -SURE -RB
GOTO END
:END

[ Last edited by qwe1234567 on 2006-10-21 at 23:17 ]
Floor13 zerostudy Posted 2006-10-22 01:06
中级用户 Posts 98 Credits 266
Thanks. Originally I just wanted to recover it.... I'll try again later.... I'll add a password to Ghost. That way, I won't accidentally let others press recover when using the computer......

config.sys cannot run ghost.exe; it needs to be added in autoexec.bat; does the version master's writing count as running in config?
Floor14 winzhzhq2006 Posted 2006-10-22 10:19
新手上路 Posts 4 Credits 8
Thanks to the brothers upstairs!
Floor15 zhengxiang Posted 2006-11-03 05:24
初级用户 Posts 24 Credits 68
Thanks
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023