[Tool] SYSCOPY (Autoexec+Config backup)

Discuss MS-DOS, Windows 1, 2 and 3.
Post Reply
os2fan2
User avatar
Donator
Posts: 1394
Joined: Sun Dec 30, 2007 8:12 am
Location: Brisbane, Queensland
Contact:

[Tool] SYSCOPY (Autoexec+Config backup)

Post by os2fan2 »

Back in 1992, i wrote this little batch file, to save AUTOEXEC.BAT to somename.BA_ abd CONFIG.SYS to somename.SY_, That is matched files have matched 'somename'. It is actually handy enough that it's been modified a number of times.

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

Darkstar
User avatar
Donator
Posts: 1212
Joined: Fri May 14, 2010 1:29 pm
Location: Southern Germany

Re: [Tool] SYSCOPY (Autoexec+Config backup)

Post by Darkstar »

Hm. I had a CONFIG.SYS with around 8 different configurations and an AUTOEXEC.BAT which was around 100 lines and called multiple sub-batchfiles depending on which config was selected. It was a pain to keep this working, as every program that tried to add/remove something from these files eventually screwed up and I had to replace them with known-good files again. I made batch files just for this purpose (to save and restore the config.sys/autoexec.bat files) because it happened so often :)
I upload stuff to archive.org from time to time. See here for everything that doesn't fit BA

Post Reply