Newsletter
February 1998
9802
Batch file to back up WIN95 system files.
The previous page is a batch program that I use to make a copy of all my WIN95 system files before I make major configuration changes. It was inspired by the book Windows 95 Unleashed - by Paul McFedries from Sams Publishing.
NOTE: This program will only run correctly from a pure DOS session. This is because the windows registry is locked under Win95. The program will still run, but an ASCII dump of the registry will not be written.
The first part for the program checks to see what directory you want to put the files in and creates it if it does not exist.
Next, the normal boring windows system files are copied into the directory. User.dat and system.dat are the Win95 registry files.
We then use regedit to dump an ascii version of the registry files. These can be used to create a difference report in case something goes wrong.
The last few commands dump a directory listing of the windows and windows\system directories to text files. This will allow us to check for any DLLs or other system files that were changed.
The registry is the heart of your Win95 system. Protect it! I wish I had this batch file when I first got my system. I would have saved me a number of headaches.
Mark Pendergast
REM
REM Program to back up WIN95 critical files to a sub-dir of the backup directory.
REM
C:
CD \Windows
IF "%1"=="" GOTO BADDEST
IF EXIST C:\BACKUP\%1 GOTO BADDIR
ECHO CREATE DIRECTORY C:\BACKUP\%1 ...
MKDIR C:\BACKUP\%1
ECHO BACKING UP FILES TO C:\BACKUP\%1 ...
XCOPY C:\WINDOWS\SYSTEM.DAT C:\BACKUP\%1\ /H /K
XCOPY C:\WINDOWS\USER.DAT C:\BACKUP\%1\ /H /K
XCOPY C:\WINDOWS\WIN.INI C:\BACKUP\%1\ /H /K
XCOPY C:\WINDOWS\SYSTEM.INI C:\BACKUP\%1\ /H /K
XCOPY C:\WINDOWS\PROTOCOL.INI C:\BACKUP\%1\ /H /K
XCOPY C:\CONFIG.SYS C:\BACKUP\%1\ /H /K
XCOPY C:\AUTOEXEC.BAT C:\BACKUP\%1\ /H /K
XCOPY C:\IO.SYS C:\BACKUP\%1\ /H /K
XCOPY C:\MSDOS.SYS C:\BACKUP\%1\ /H /K
REGEDIT /L:C:\WINDOWS\SYSTEM.DAT /R:C:\WINDOWS\USER.DAT /E C:\BACKUP\%1\REG.REG
DIR C:\WINDOWS /A-D /ON > C:\BACKUP\%1\WINDIR.TXT
DIR C:\WINDOWS\SYSTEM /A-D /ON > C:\BACKUP\%1\WINSYDIR.TXT
GOTO END
;
:BADDEST
ECHO *ERROR* NO DESTINATION SPECIFIED !!!
GOTO END
;
:BADDIR
ECHO *ERROR* DESTINATION EXISTS, PLEASE DELETE IT !!!
DIR C:\BACKUP\%1
GOTO END
;
:END
Return to the Archive