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-07-23 13:00
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » [Seeking revisions] System install/backup/restore boot disk (Chinese) View 2,179 Replies 21
Original Poster Posted 2003-07-25 00:00 ·  中国 黑龙江 牡丹江 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
I practiced making a system install/backup/restore boot disk that includes GHOST7.5, and I sincerely ask the moderator and everyone to give advice, make changes, and help improve it. Thank you!
Since I don't understand DOS, there will definitely be many places that make everyone laugh, so please forgive me and help me out.
Is it possible to intelligently back up the image to the last partition of the hard disk.
What commonly used tools should be added.




@echo off

set EXPAND=YES
SET DIRCMD=/O:N
set comspec=a:\command.com
path=a:\;c:\
lh a:\TW /np
lh a:\mouse.exe
lh a:\mscdex.exe /d:mscd001
lh a:\doskey
lh a:\smartdrv
lh a:\ntfsdos

cls
echo.
echo.
echo.
echo.
cls

echo.
echo ====================
echo ★ “Magic” System Install Backup Restore Boot Disk ★
echo ======= Made by: QEYU =======
echo.
echo This install boot disk was made based on the Windows Millennium (MS-DOS 8.0) Bootdisk,
echo and is suitable for system installation under DOS, GHOST operations, etc.
echo During the making of this boot disk, I received technical support from China DOS Union and
echo CCF Quality Technology Forum, and I would like to express my thanks here.
echo.
echo ○ This boot disk has automatically loaded HIMEM and SMARTDRV, and can directly install operating systems.
echo ○ It can run the FDISK program to partition the hard disk.
echo ○ You can use the FORMAT command to format partitions.
echo ○ It can perform GHOST operations such as automatic or manual system backup and system restore.
echo.
echo.
echo ■ Operation menu:
echo.
echo 1 ─ Automatic system backup
echo 2 ─ Automatic system restore
echo 3 ─ Manual GHOST operation
echo 4 ─ Enter DOS prompt
echo.
choice /c:1234 ▲ Please press the number of the item listed above to make your selection

if errorlevel 4 goto tishifu
if errorlevel 3 goto shoudong
if errorlevel 2 goto huifu
if errorlevel 1 goto beifen

:beifen
echo.
echo You have selected automatic system backup. Please wait...
a:\ghost.exe -clone,mode=pdump,src=1:1,dst=d:\system.gho -sure
echo.
echo.
echo ◇ Automatic system backup is complete. Please remove the floppy disk and press Ctrl+Alt+Del to restart the system.
goto end

:huifu
echo.
echo You have selected automatic system restore. Please wait...
a:\ghost.exe -clone,mode=pload,src=d:\system.gho:1,dst=1:1 -sure
echo.
echo.
echo ◇ Automatic system restore is complete. Please remove the floppy disk and press Ctrl+Alt+Del to restart the system.
goto end

:shoudong
echo.
echo You have selected manual GHOST operation. Please wait while entering the GHOST interface...
a:\ghost.exe
echo.
echo.
echo ◇ Please carry out other operations, or press Ctrl+Alt+Del to restart the system.
goto end

:tishifu
cls
echo.

:end
echo.


device=a:\himem.sys /testmemff
devicehigh=a:\vide-cdd.sys /d:mscd001
dos=high,umb,auto
files=30
buffers=30
stacks=9,256
lastdrive=Z
Floor 2 Posted 2003-07-25 00:00 ·  中国 上海 徐汇区 电信
中级用户
5 M
Credits 238
Posts 44
Joined 2003-03-15 00:00
23-year member
UID 1140
Gender Male
Status Offline
You can use dready to determine the last drive letter,

set lastdrv=
for %%i in ( q p o n m l k j i h g f e d c) do call chkdrv.bat %%I
your command


Contents of chkdrv.bat
if not %lastdrv%'==' goto _end
dready %1 /w
if errorlevel 2 goto _end
set lastdrv=%1
_end
Add wbat and locate and you can select and determine the gho file
Once it's written, let everyone enjoy it, okay
Floor 3 Posted 2003-07-25 00:00 ·  中国 广东 河源 电信
高级用户
★★
Credits 916
Posts 201
Joined 2003-05-04 00:00
23-year member
UID 1849
Gender Male
Status Offline
Please post it as an attachment for everyone to enjoy, thanks!
Floor 4 Posted 2003-07-26 00:00 ·  中国 黑龙江 牡丹江 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
The following is quoted from dsm75's post at 2003-7-25 22:01:53:
You can use dready to determine the last drive letter,

setlastdrv=
for%%iin(qponmlkjihgfedc)docallchkdrv.bat%%I
yourcommand

chkdrv.batContents:
ifnot%lastdrv%''''==''''goto_end
dready%1/w
iferrorlevel2goto_end
setlastdrv=%1
_end
Add wbat and locate and you can select and determine the gho file
Once it's written, let everyone enjoy it, okay


I can't make sense of it, it's really troublesome, and I just can't connect it with Ghost.
What I uploaded defaults to backing up to drive D:, so please help revise and correct it.
Many thanks!

Open attachment

Floor 5 Posted 2003-07-26 00:00 ·  中国 黑龙江 牡丹江 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
The following is quoted from walu's post at 2003-7-25 22:11:30:
Please post it as an attachment for everyone to enjoy, thanks!


I've uploaded it.
I also hope we can improve it together. Thanks!

Doing something practical for LP and MM is the purpose behind making this boot disk.
Floor 6 Posted 2003-07-26 00:00 ·  中国 广东 肇庆 电信
高级用户
★★
Credits 578
Posts 135
Joined 2003-07-10 00:00
23-year member
UID 6709
Gender Male
Status Offline
Jumping in:
This is my own backup/restore disk for personal use, please help improve it!
Questions:
1. I want to change the default backup destination from drive D: to the first partition after D: that has more than 2G of free space. How can this be done?
2. Can wbat display prompt text on multiple lines (sometimes I want to write more detailed prompt information)? How can this be done?


@ECHO Off
CLS
SMARTDRV > NUL
LH KILLER > NUL
LH DOSKEY > NUL
LH CTMOUSE > NUL
LH MOUSCLIP /M > NUL
LH SHSUCDX /d:MSCD000 > NUL
LH DOSLFN /Z:CP936UNI.TBL > NUL
XMSDSK 2048 /Y > NUL
FINDCD > NUL
FINDRAMD > NUL
PKUNZIP -o %RAMDRIVE%\ DOSCAB.ZIP > NUL
PATH=%RAMDRIVE%.;A:.;%CDROM%.;C:.;D:.;E:.;F:..G:.;H:.;I:.;J:.;K:.;L:.;M:.;N:.;O:.;P:.;Q:.;R:.;S:.;T:.;U:.;V:.;W:.;X:.;Y:.;Z:
LH TW /NP > NUL
CLS

:Begin
cls
WBAT BOX "SYMANTEC GHOST Backup/Restore Program! (Please make your selection within 15 seconds)",Auto backup,Auto restore,Man ual,Ex it #4,15
IF ERRORLEVEL 4 goto end
IF ERRORLEVEL 3 goto _Manual
IF ERRORLEVEL 2 goto _Restore
IF ERRORLEVEL 1 goto _Backup

:_Backup
cls
WBAT BOX "The program will automatically create a 696MB split image backup of drive C on drive D!",Confi rm,Ret urn,Ex it #3
IF ERRORLEVEL 3 goto end
IF ERRORLEVEL 2 goto Begin
IF ERRORLEVEL 1 goto _Autobackup

:_Autobackup
ghost -clone,mode=pdump,src=1:1,dst=D:\backup.gho -split=696 -z9 -auto -sure
goto _end

:_Restore
cls
WBAT BOX "Please choose the backup you want to restore!",CD backup,Other backup,Ret urn,Ex it #4
IF ERRORLEVEL 4 goto end
IF ERRORLEVEL 3 goto Begin
IF ERRORLEVEL 2 goto _Select
IF ERRORLEVEL 1 goto _Cdrom

:_Cdrom
WBAT BOX "The existing data on drive C will be completely deleted! Do you really want to restore the CD backup?",Confi rm,Choose again,Ex it #3
IF ERRORLEVEL 3 goto end
IF ERRORLEVEL 2 goto _Restore
IF ERRORLEVEL 1 goto _Restore1
:_Restore1
ghost -clone,mode=pload,src=%CDROM%\backup.gho:1,dst=1:1 -auto -sure
goto _end

:_Select
cls
set get=
get s "Please enter the full name of the backup file to restore (including extension):"
copy /y backup.bat %ramdrive%\ > nul
for %%a in (d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z do if exist %%a\%get% dir /b /s %%a\%get% >>%ramdrive%\backup.bat
call %ramdrive%\backup.bat
if not %backup%"==" goto _find
WBAT BOX "Sorry! The backup file you wanted to restore was not found",Re-enter,Backup list,Ex it #3
IF ERRORLEVEL 3 goto end
IF ERRORLEVEL 2 goto dir_gho
IF ERRORLEVEL 1 goto _Select

:_find
cls
WBAT BOX "The backup file has been found. If restore is executed, the existing data on drive C will be completely deleted!",Confi rm,Re-enter,Ex it #3
IF ERRORLEVEL 3 goto end
IF ERRORLEVEL 2 goto _Select
IF ERRORLEVEL 1 goto _Restore1

:_Restore1
ghost -clone,mode=pload,src=%backup%:1,dst=1:1 -auto -sure
goto _end

:dir_gho
cls
WRITEXT 1+ 1 -f10 The list of backup files on your computer is as follows:
echo.
for %%a in (d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z do if exist %%a\*.gho dir /b /s %%a\*.gho
WBAT BOX "If the backup file exists, the program will list it here!",Return to start,Re-enter,Ex it #3
IF ERRORLEVEL 3 goto end
IF ERRORLEVEL 2 goto _Select
IF ERRORLEVEL 1 goto Begin

:_end
%RAMDRIVE%\
reboot.bat

:_Manual
ghost.exe

:end
cls
a:\


set backup=


cls
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
WRITEXT 0+ 23 -f10 Please remove the CD and press any key to restart your computer !
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
eject.com > NUL
pause > nul
reboot.com > nul
Floor 7 Posted 2003-07-28 00:00 ·  中国 湖北 宜昌 教育网
中级用户
5 M
Credits 238
Posts 44
Joined 2003-03-15 00:00
23-year member
UID 1140
Gender Male
Status Offline
Below is a simple example of using wbat to display prompt text on multiple lines.

findcd >nul
FINDRAMD>NUL
echo @echo off >%tmp%\_menu.bat
echo %RAMDRIVE% >>%tmp%\_menu.bat
echo call w.bat pal ! cls ! box @%%0:_txt #1,15>>%tmp%\_menu.bat
echo if errorlevel 2 goto exit>>%tmp%\_menu.bat
echo if errorlevel 1 call menu.bat>>%tmp%\_menu.bat
echo goto exit>>%tmp%\_menu.bat
echo :_txt "Congratulations, you have successfully booted the system">>%tmp%\_menu.bat
echo.>>%tmp%\_menu.bat
IF NOT %CDROM%#==# ECHO Your CD-ROM drive has been loaded as drive %CDROM% >>%tmp%\_menu.bat
IF NOT %CDROM%#==# ECHO.>>%tmp%\_menu.bat
IF NOT %RAMDRIVE%#==# ECHO Your virtual drive has been loaded as drive %RAMDRIVE% >>%tmp%\_menu.bat
IF NOT %RAMDRIVE%#==# ECHO.>>%tmp%\_menu.bat
ECHO If you want to start the graphical menu, type menu at the command line to start the menu>>%tmp%\_menu.bat
ECHO.>>%tmp%\_menu.bat
ECHO The graphical menu will now start in #? seconds>>%tmp%\_menu.bat
echo.>>%tmp%\_menu.bat
echo >>%tmp%\_menu.bat
echo :exit>>%tmp%\_menu.bat
echo set wbat=>>%tmp%\_menu.bat
%RAMDRIVE%
call %tmp%\_menu.bat
goto exit
Floor 8 Posted 2003-07-28 00:00 ·  中国 上海 宝山区 电信
金牌会员
★★★★
小飞侠
Credits 4,590
Posts 1,812
Joined 2003-04-02 00:00
23-year member
UID 1400
Gender Male
From 上海市
Status Offline
It would be best to load smartdrv twice
At the same time, smartdrv should also have appropriate parameters!
For example, the most important thing is the cache size,
Add more, 16MB would be pretty fierce!
If you don't add parameters, it's equivalent to loading only 256KB!
That's really far too little!
Floor 9 Posted 2003-07-29 00:00 ·  中国 江苏 无锡 电信
高级用户
★★
Credits 616
Posts 187
Joined 2003-04-18 00:00
23-year member
UID 1598
Gender Male
Status Offline
The following is quoted from 沈洁's post at 2003-7-28 22:28:45:
It would be best to load smartdrv twice
At the same time, smartdrv should also have appropriate parameters!
For example, the most important thing is the cache size,
Add more, 16MB would be pretty fierce!
If you don't add parameters, it's equivalent to loading only 256KB!
That's really far too little!


If you don't add parameters, when smartdrv is loaded it automatically decides the cache size according to the size of the computer's extended memory.
Under DOS:
Extended memory: 2M
Cache size: 1M

Extended memory: 6M
Cache size: 2M

256K is when the extended memory is only 2M, and the cache size when using WINDOWS.
Floor 10 Posted 2003-07-29 00:00 ·  中国 黑龙江 牡丹江 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
@echo off
if not %lastdrv%'==' goto _end
if %1'==' goto _end
if %1==%cdrom% goto _end
if %1==%RAMDRIVE% goto _end
dready %1 /w
if errorlevel 2 goto _end
set lastdrv=%1
:_end


Why is the lastdrv found the CD-ROM drive? Is it related to %CDROM% and %RAMDRIVE%? What exactly should I do?
Floor 11 Posted 2003-07-29 00:00 ·  中国 湖北 武汉 联通
中级用户
★★
Credits 230
Posts 53
Joined 2003-06-11 00:00
23-year member
UID 4799
Gender Male
Status Offline
Post it and let us have a look
Floor 12 Posted 2003-07-29 00:00 ·  中国 黑龙江 牡丹江 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
The following is quoted from QEYU's post at 2003-7-29 8:03:28:
@echo off
if not %lastdrv%'==' goto _end
dready %1 /w
if errorlevel 2 goto _end
set lastdrv=%1
:_end


Why is the lastdrv found the CD-ROM drive? Is it related to %CDROM%、%RAMDRIVE% ? What exactly should I do?


The problem is solved. I used a makeshift workaround:
before items like "Automatic system backup" and "Automatic system restore", do not load the CD-ROM drive; only load the CD-ROM drive before the "Enter DOS prompt" item.

Thank you all very much for your help!
Floor 13 Posted 2003-07-29 00:00 ·  中国 浙江 宁波 余姚市 电信
中级用户
5 M
Credits 238
Posts 44
Joined 2003-03-15 00:00
23-year member
UID 1140
Gender Male
Status Offline
if %1==%cdrom% goto _end checks whether it is the CD-ROM drive
if %1==%RAMDRIVE% goto _end checks whether it is the virtual drive,
if it is, goto _end and skip it
if not, use the tool dready %1 /w to check whether that drive exists
Floor 14 Posted 2003-07-30 00:00 ·  中国 黑龙江 牡丹江 联通
中级用户
新DOS时代绿色菜狼
Credits 229
Posts 42
Joined 2003-07-03 00:00
23-year member
UID 6341
Gender Male
Status Offline
The following is quoted from dsm75's post at 2003-7-29 21:14:34:
if %1==%cdrom% goto _end checks whether it is the CD-ROM drive
if %1==%RAMDRIVE% goto _end checks whether it is the virtual drive,
if it is, goto _end and skip it
if not, use the tool dready %1 /w to check whether that drive exists



At first I did it this way too, but lastdrv was still cdrom. Maybe it wasn't loaded into %cdrom%?

This super newbie asks one more question: how do you load a virtual drive? Ghost keeps writing the ghosterr.txt file to drive A:. What exactly should I do?
Floor 15 Posted 2003-07-31 00:00 ·  中国 湖北 宜昌 教育网
中级用户
5 M
Credits 238
Posts 44
Joined 2003-03-15 00:00
23-year member
UID 1140
Gender Male
Status Offline
%cdrom% is a variable automatically assigned by Wengier's dos boot disk's fincd file. %RAMDRIVE% is also automatically assigned by Wengier's findramd file
You can add this at the end of autoexec.bat
findcd >nul
findramd >nul
and then copy these two files to drive A:


xmsdsk 4096 /y /t can load a virtual drive
For details, you can look at Wengier's boot disk, there are still quite a lot of useful things in it
Forum Jump: