Click to See Complete Forum and Search --> : Registry Backup


Windowscrash
July 14th, 2001, 09:05 AM
I have made a very simple batch file which, when run will copy all *.dat files in the Windows directory to a folder on the hard disk.

If you want a copy please send an email to et.trachy@bigbluesky.uk.net

ReBoot
July 14th, 2001, 08:21 PM
Here's one I wrote quite awhile ago. Backs up more than just the reg.
There's also a restore.bat to (duh) restore the backups made with this .bat

<font color="Red">
@echo off
cls
echo Jim (reboot) Delong's backup.bat, a Win9x/ME backup tool.
echo ---------------------------------------------------------
echo Copyright (c) 2000 Jim Delong
echo http://members.cnx.net/reboot
echo version 1.2 October 4/2000
rem Version 1.2 Now backs up Netscape bookmarks
echo ---------------------------------------------------------
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo Important!!!!!!!!!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo You MUST run this from the root directory of your
echo hard drive. If this file is NOT saved in root C:\
echo you MUST hit ctrl-c now and save it there!
echo DO NOT run this from any other folder or the desktop,
echo it will not work correctly!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo.
echo If you have NOT saved this file in the root C:\ folder,
echo hit ctrl-c now, otherwise
pause
echo Use Notepad to view this file's contents before running!
echo Who knows, you may learn a little about DOS.
echo Only you can determine if the file contents and
echo structure are OK to run on *your specific* setup.
echo -----------
:: This file is offered as-is and without warranty of any kind.
:: This file may redistributed as long as all header information
:: is retained in the final file.
echo This file assumes your Windows folder is at c:\Windows
echo If it isn't, you must change the path below to your Windows folder.
echo This file backs up the c:\windows\favorites folder, the
echo c:\my documents folder, Netscape bookmarks, and the two
echo files that make up the Windows registry.
echo (user.dat and system.dat)
echo.
echo Bonus! You may now run this file within windows!
echo No need to restart in DOS mode.
echo ---------------------------------------------------------
echo Hit ctrl-c to abort or
pause
cls
echo.
echo Making a backup folder. This folder is called "backups".
echo Please stop now and edit this .bat file
echo if you wish to change the path or name.
echo Hit ctrl-c to abort or
pause
rem --------------------------------------------
echo Making backup folders
echo.
rem --------------------------------------------
md backups
cd backups
md faves
md mydocs
md registry
rem add any other subdirectories here.
rem Be sure to use the correct syntax, eg. md foldername
rem ---------------------------------------------
echo Add as many subdirectories as you like above.
echo This file only makes backups of your favorites folder
echo your My Documents folder, and the two registry files.
echo.
rem ---------------------------------------------
cd\
echo.
echo Now backing up your favorites and other folders.
echo.
rem --------------------------------------------------
echo This now backs up IE favorites, and INetscape bookmarks.
echo.
pause
rem ----------------------------------------------------------------------------
rem If you added more folders above, you MUST add the appropriate path below.
rem ----------------------------------------------------------------------------
rem Add any subsequent backup pathnames here. Be sure to use the syntax:
rem echo Backing up Favorites.
rem xcopy32 c:folderpath\foldername\*.* c:\backups\foldername /y /s
rem echo.
rem echo Successfully backed up your Favorites folder.
rem ---------------------------------------------------------------------------------
echo Backing up Favorites.
xcopy32 c:windows\favori~1\*.* c:\backups\faves /y /s
echo If you do not have Internet Explorer this may give an error. Ignore it.
echo.
echo Successfully backed up your Favorites folder.
echo.
echo Now backing up Netscape bookmarks.
echo If you don't have Netscape, this will give an error. Ignore it.
xcopy32 C:\Progra~1\Netscape\Commun~1\Program\defaults\boo kmark.htm c:\backups\faves /y /s
echo Successfully backed up your Netscape bookmarks.
echo.
echo I will now back up your My Documents folder.
echo Hit ctrl-c if you wish to quit now, otherwise
pause
echo Backing up My Documents
xcopy32 c:\mydocu~1\*.* c:\backups\mydocs /y /s
echo.
echo Successfully backed up your My Documents folder.
echo I will now backup your registry files.
echo Hit ctrl-c if you wish to quit now, otherwise
pause
echo.
echo Backing up the registry.
cd windows
attrib -h -r -s -a user.dat
attrib -h -r -s -a system.dat
attrib -h -r -s -a win.ini
attrib -h -r -s -a system.ini
xcopy32 c:\windows\user.dat c:\backups\registry\ /y /s
xcopy32 c:\windows\system.dat c:\backups\registry\ /y /s
xcopy32 c:\windows\win.ini c:\backups\registry\ /y /s
xcopy32 c:\windows\system.ini c:\backups\registry\ /y /s
echo.
echo Successfully backed up your Registry.
rem Don't worry about resetting the attributes of the registry files.
rem Windows will do that automatically upon your next restart.
pause
echo.
echo Successful backup!
echo.
echo It is recommended you copy the contents of the c:\backups folder somewhere
echo for safe keeping.
echo You may close this window now.
</font>

Daemon
July 17th, 2001, 11:01 AM
ahhaha for how all those lines of code ill make a vb program and its a gui and which will have less line of code lol.


But good work <IMG SRC="smilies/smile.gif" border="0">

ReBoot
July 17th, 2001, 11:42 AM
If you look, there's only about 10 lines of code, the rest is instructions, prompts, text...
I wrote it that way so even a scared newbie may be able to run it without too much trepidation.

kannibul
July 18th, 2001, 06:19 PM
Originally posted by reboot:
<STRONG>If you look, there's only about 10 lines of code, the rest is instructions, prompts, text...
I wrote it that way so even a scared newbie may be able to run it without too much trepidation.</STRONG>

why not use the "cd \" to start with? then you wouldn't have to worry about it being ran from the root of c:

ReBoot
July 19th, 2001, 09:45 AM
Because then the backups won't be saved in root C: and the restore.bat won't find any backups, unless the code is changed.
Most newbies don't want to have to rewrite parts of a .bat to get it to work right.
I tried it both ways, and determined that this was the easiest/safest way (most idiot proof?).