For use under DOS, as small as possible
Teamwork !
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!
::BOOTMAN.BAT - By Will Sort, 2004/03/13
@echo off
if == goto help
set file=%3
if == set file=boot_%2.dat
for %%a in (S s SAVE save) do if == goto save
for %%a in (L l load save) do if == goto load
:help
echo.
echo BOOTMAN.BAT - Boot sector save/restore tool
echo.
echo Usage: BOOTMAN specifies operation specifies disk
echo Operation: S s SAVE save are all for saving, L l LOAD load are all for restoring;
echo Disk: A is 0, B is 1, and so on
echo File: Complete file name, if not specified, it is boot_disk parameter.dat
goto end
:savepre
echo L 100 %2 0 1>%temp%.\bootman.asd
echo N %file%>>%temp%.\bootman.asd
echo W>>%temp%.\bootman.asd
echo Q>>%temp%.\bootman.asd
goto operate
:loadpre
echo L 100 %2 0 1>%temp%.\bootman.asd
echo N %file%>>%temp%.\bootman.asd
echo W>>%temp%.\bootman.asd
echo Q>>%temp%.\bootman.asd
goto operate
perate
if not exist %temp%.\bootman.asd
debug nul
echo Operation completed!
del %temp%.\bootmam.asd
set file=
:end
The following is the speech of qzwqzw on 2004-3-9 21:43:16:
Debug is the best, also very small, and not to worry about not finding.
Read disk boot sector
-L 100 0 0 1
-N boot.dat
-W
-Q
Write disk boot sector
-N boot.dat
-L
-W 100 0 0 1
-Q
100 refers to the memory address for saving or reading
The first 0 refers to drive A, drive C is 2, and so on