Now, you can save AUTOEXEC.ext and CONFIG.ext (eg .DOS, .W40, .WOS, .WIN), or copy from or to a directory (eg c:\disks\floppy\AUTOEXEC.BAT etc. One use, is when you make a DOS vm, you just install DOS as the manufacturer wants, and then run this batch file to copy A:\VPC-C.
Touching files to the current date/time gets around QEMM updating files you just replaced.
syscopy c:\ d:\saved\msdos saves A and C to d:\saved\msdos.ba_ and .sy_
syscopy d:\mboot .wos /! restores mboot.sy_ to config.wos and mboot.ba_ to autoexec.wos and updates dates
Code: Select all
@echo off
::~ restore autoexec config
:: Wendy Krieger - an os2fan2
if %1d==d goto :ttyhelp
if d%1==d-? goto :ttyhelp
if d%1==d/? goto :ttyhelp
set ZK0=copy /b
set ZK2=+,,
if %3/==/!/ goto :touch
set ZK0=copy
set ZK2=
:touch
set ZK1=%1
if exist %1.ba_ set ZK1=%2
if exist nul%ZK1% goto :ext
if not exist %ZK1%autoexec.bat set ZK1=%ZK1%\
if exist %1.ba_ goto :rest1
%ZK0% %ZK1%config.sys%ZK2% %2.sy_
%ZK0% %ZK1%autoexec.bat%ZK2% %2.ba_
goto :end
:rest1
%ZK0% %1.sy_%ZK2% %ZK1%config.sys
%ZK0% %1.ba_%ZK2% %ZK1%autoexec.bat
goto :end
:ext
if exist %1.ba_ goto :rest2
%ZK0% config%ZK1%%ZK2% %2.sy_
%ZK0% autoexec%ZK1%%ZK2% %2.ba_
goto :end
:rest2
%ZK0% %1.sy_%ZK2% config%ZK1%
%ZK0% %1.ba_%ZK2% autoexec%ZK1%
goto :end
:ttyhelp
echo SYSCOPY saves and restores config.sys and autoexec.bat. The copies are
echo stored as filename.sy_ and filename.sy_. Touching files is permitted.
echo.
echo backup SYSCOPY sourcefile basename [/!]
echo restore SYSCOPY basename sourcefile [/!]
echo.
echo basename: autoexec.bat becomes basename.ba_
echo config.sys becomes basename.sy_
echo sourcefile: path A path with or without a trailing \ eg c:\
echo .ext autoexec.ext and config.ext are the sourcefiles
echo.
echo /! optional touch by copy /b name +,,
goto :eof
:end
set ZK0=
set ZK1=
set ZK2=
set ZK3=
:eof