China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 20:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch backup of the WinXP&2000&2003 registry View 1,128 Replies 11
Original Poster Posted 2008-08-21 14:25 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
A batch file for backing up the registry in winxp&2000&2003, who knows how to do it?

When XP is running normally, trying to copy the files in C:\WINDOWS\system32\config is not successful. Can it be done like in win98, backing up through a batch file at startup and keeping the latest 5 copies? What I hope for here is to keep more days' worth, such as having backups for 30 days, once per day, and then deleting the backup from 30 days ago. Asking for advice.
Floor 2 Posted 2008-08-21 14:30 ·  中国 北京 海淀区 联通
银牌会员
★★★
Credits 1,287
Posts 634
Joined 2007-05-02 15:06
19-year member
UID 87277
Gender Male
From cmd.exe
Status Offline
Floor 3 Posted 2008-08-21 14:44 ·  新加坡
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
2000 doesn't have reg.exe, does it?
Floor 4 Posted 2008-08-21 14:44 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
How do you back it up and restore it then?
Floor 5 Posted 2008-08-21 14:52 ·  新加坡
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
regedit
/s import a .reg file into the registry (silent mode)
/e export a registry file
Example: regedit /e filename.reg HKEY_LOCAL_MACHINE\\SYSTEM
/L:system specify system.dat
/R:user specify user.dat
/C compress [filename] (Windows 98)
Floor 6 Posted 2008-08-21 14:55 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
Can a full backup be done every time?

I tried manually using regedit to export and generate a full backup .reg file, but when restoring under normal xp operation it reports errors and can't restore. How should this situation be restored?
Floor 7 Posted 2008-08-21 15:22 ·  中国 广东 广州 天河区 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
Do you want to restore it under pure DOS?
知,不觉多。不知,乃求知
Floor 8 Posted 2008-08-21 17:06 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
If a reg file is exported with regedit under xp, how do you restore it under pure DOS??
Floor 9 Posted 2008-08-21 21:30 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
Did everyone go watch the Olympics?
Floor 10 Posted 2008-09-11 22:48 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
Creating a batch file for automatic date-based backups

  ERUNT has a very convenient feature: it can run at the command prompt. By using some of its parameters, it can automatically save the registry files into a folder named with the current date.

  Open a text file and enter the following:
  C:\erunt\ERUNT.EXE %SystemRoot%\ERDNT\#Date# /noconfirmdelete
  The first part is the path where the file is located, and the second part is the "backup to" location, that is, the C:\WINNT\ERDNT directory, using the current date as the subfolder name. "noconfirmdelete" means that if a folder with the same name exists, it will be deleted automatically.

  Save this file as "backupreg.bat" and place it on the desktop for easy use at any time.

  Tip

  A free little registry optimization tool

  In the folder where ERUNT is located, there is also a little tool called "NTREGOPT.EXE". After double-clicking to run it, the program will automatically scan the registry and provide a report of the registry size before and after "slimming down". Just press "OK" to complete the registry optimization.

  Step 3: When to back up the registry

  Although you can put this batch file in "Start→Programs→Startup" or use it as a logon script, thus achieving automatic backup at Windows startup like Windows 98, or use "Scheduled Tasks" for timed backups, we think that is unnecessary. In fact, the best time to back up the registry is: before updating system files or drivers, before installing new programs (while Windows is still running properly), or before performing risky operations. At those times, just double-click this batch file to back up the registry, and the backup files will be saved in a folder like "C:\WINNT\ERDNT\2004-8-15”".

  Step 4: Restore the registry

  If the system can still boot normally, then you can directly go into the "C:\WINNT\ERDNT\”" folder, choose a previous backup subfolder (for example: "2004-8-15"), and then run "ERDNT.EXE" inside it to restore the registry.

  If the system cannot boot, you can try pressing F8 at the startup menu and choosing "Last Known Good Configuration". If that does not work, try entering Safe Mode. If neither works, then you need to use the following method to restore the registry.

  Method 1: If a dual-boot system is installed, you can enter the other normal Windows and run "ERDNT.EXE" in the backup folder to restore. If the drive letters have changed in the other Windows, for example, if drive C becomes drive D, then before restoring, use Notepad to open the "ERDNT.INF" file in the backup folder and replace all "C:" entries in it with "D:".

  Method 2: Boot the system with the Windows 2000/XP installation CD. At the setup welcome menu, press R, then press C to enter the Recovery Console, then enter the password to log into the system. Next, enter the command "CD C:\WINNT\ERDNT”" to go to the folder where the registry backup files are stored, and then use the CD command again to enter the corresponding backup folder, for example: "CD 2004-8-15".

  Then enter the command "batch erdnt.con" and press Enter. This will restore the backed-up registry files. When finished, enter "exit" to leave the Recovery Console. The system will then restart using the selected registry backup.

  Tip

  ★Cases where the registry cannot be restored or restoring has no effect

  The device or device driver is damaged, so restoring has no effect.
  System files are damaged or missing, so restoring has no effect.
  The hard disk has logical or physical damage, or there is a partition table error, so restoring has no effect.
  A virus infection has not been completely removed, so restoring has no effect.

  ★Install the Recovery Console onto the hard disk

  Is it a bit troublesome to use the Windows 2000/XP installation CD every time to enter the Recovery Console? Actually, you only need to put the installation CD into the CD-ROM drive, then press Win+R, enter "X:\i386\winnt32.exe /cmdcons" (where "X" is the drive letter of the CD-ROM drive; please modify it according to your actual situation), and after pressing Enter, the Recovery Console can be installed onto the hard disk. Later, when restoring the registry, you only need to choose the Recovery Console option from the startup menu to enter it quickly and perform the restore.

[ Last edited by qwertl on 2008-9-16 at 01:19 PM ]
Floor 11 Posted 2008-09-16 13:34 ·  中国 广东 东莞 电信
中级用户
★★
Credits 461
Posts 243
Joined 2007-10-14 16:56
18-year member
UID 99730
Gender Male
Status Offline
Automatically back up the registry at startup

  Step 1: Download and install it from http://home.t-online.de/home/lars.hederer/erunt/erunt-setup.exe. After completion, an "ERUNT AutoBackup" item will be added to "Start→Programs→Startup". This way, each time Windows starts, it will automatically create a folder named with the current date in the C:\WINNT\ERUNT folder, and back up the current registry there. For the restoration method, you can refer to the article "Ultimate Backup and Restore for the Windows 2000/XP Registry".

  Step 2: By default, the automatic registry backup at startup function keeps 28 days of registry backups, and it can automatically delete backups older than 28 days. If you want to reduce or increase the number of backup days, right-click "ERUNT AutoBackup" in "Start→Programs→Startup", choose "Properties", then on the "General" tab add a space at the end of the "Target" text box, and then enter "/days:7". This changes it to keeping 7 days of backups, and backups older than 7 days are automatically deleted. You can modify the number of days as needed.

Easily Chinese-localize ERUNT

  At present ERUNT still does not provide a Simplified Chinese language pack. Do you want to Chinese-localize it yourself and provide it to the author so he can publish it on his own webpage? It's very simple—even a newbie can easily do it.

  Use Notepad to open the ERUNT.LOC file in ERUNT's installation folder. You only need to modify the English after the "#"(see the picture). Also, note that some sentences span multiple lines. This is mainly due to the window size, so overly long sentences are displayed on multiple lines in the window. Therefore, you need to treat the text after multiple "#" marks as one sentence when translating, and then split it up again and write it after the "#" marks.
Floor 12 Posted 2008-09-16 19:01 ·  中国 浙江 杭州 余杭区 电信
初级用户
★★
Credits 155
Posts 74
Joined 2007-02-21 07:24
19-year member
UID 79875
Gender Male
Status Offline
I think just using copy can do it. Copy the registry files under the system folder to another place, then write a batch file to copy the backed-up registry back and replace the original files, and that's it.
Forum Jump: