Difference between revisions of "How to create an autobackup batch script"
RacoonRider (Talk | contribs) (Created page with "In dayly DOS experiments with retro hardware it is useful to have a script to automatically back up your autoexec.bat and config.sys files. While internet is full of different...") |
RacoonRider (Talk | contribs) (→External links) |
||
Line 25: | Line 25: | ||
=External links= | =External links= | ||
− | *[http://www.robvanderwoude.com/batchfiles.php] | + | *[http://www.robvanderwoude.com/batchfiles.php Rob van der Woude's Scripting Pages] |
*[http://lfntools.sourceforge.net/ LFN Tools for long file name support] | *[http://lfntools.sourceforge.net/ LFN Tools for long file name support] |
Revision as of 20:00, 16 April 2013
In dayly DOS experiments with retro hardware it is useful to have a script to automatically back up your autoexec.bat and config.sys files. While internet is full of different batch files and samples, but only few of them work in older DOS, namely 6.22.
Here's a script that automatically backs up autoexec.bat and config.sys:
;This autobackup script backs up autoexec.bat and config.sys every day. ;Created by Racoonrider for www.vogonswiki.com @ECHO OFF VER|DATE>TEMP.BAT ECHO SET DATE=%%4>CURRENT.BAT CALL TEMP.BAT DEL TEMP.BAT DEL CURRENT.BAT md C:\AUTOBACK\ lmd C:\AUTOBACK\%DATE% lcopy C:\AUTOEXEC.BAT C:\AUTOBACK\%DATE%\AUTOEXEC.BAT /y lcopy C:\CONFIG.SYS C:\AUTOBACK\%DATE%\CONFIG.SYS /y ECHO Backup created on %DATE%.
The first six lines of this script capture system date. Than a directory with a name formatted dd-mm-yyyy
is created in C:\AUTOBACK\. Your autoexec.bat and config.sys files are copied in that directory. LFN Tools extension is used to handle long directory name containing system date.
With this script added to your autoexec.bat (via CALL
function or by copying the lines directly), your autoexec.bat and config.sys will be backed up every time you turn on your PC. However, the files in the same dd-mm-yyyy
directory are overwritten.