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-06-25 12:55
中国DOS联盟论坛 » DOS学习入门 & 精彩文章 (教学室) » Repost: Using the Registry under DOS View 5,206 Replies 16
Original Poster Posted 2002-11-02 00:00 ·  中国 湖北 随州 电信
元老会员
★★★
Credits 1,987
Posts 632
Joined 2002-10-27 00:00
23-year member
UID 73
Gender Male
Status Offline
This is taken from "Computer Education News" and is specially reposted here, hoping to be helpful to friends.

The Registry Editor can not only run and be used under Windows, but also run in MS-DOS real mode. Sometimes when the registry is damaged and Windows cannot start, we can only repair or modify the registry in DOS mode. The actual physical files of the registry are System.dat and User.dat, that is to say, the data in the registry is saved in these two files.

Export Registry

This command can back up the registry file.
Command format: Regedit /L:system /R:user /E filename.reg Regpath

Parameter meaning:
/L: system specifies the path where the System.dat file is located.

/R: user specifies the path where the User.dat file is located.

/E: This parameter specifies that the Registry Editor is to perform the operation of exporting the registry. After this parameter, leave a space and enter the file name of the exported registry.

Regpath: used to specify which branch of the registry to export. If not specified, all registry branches will be exported.

If you plan to export all the branches under the HKEY_CLASSER_ROOT root key saved in C:\Windows\System.dat and C:\Windows\Profiles\User.dat to file.reg, you can execute the following command: Regedit /L:C:\Windows\ /R:C:\Windows\Profiles\ /e file1.reg HKEY_CLASSER_ROOT

Import Registry

Command format: Regedit /L:system /R:user file.reg

Parameter meaning:
/L: system specifies the path where the System.dat file is located.

/R: user specifies the path where the User.dat file is located.

Rebuild Registry

Rebuilding the registry means re-establishing the System.dat and User.dat files.

Command format: Regedit /L:system /R:user /C file.reg

Parameter meaning:
/L: system specifies the path where the System.dat file is located.



/R: user specifies the path where the User.dat file is located.

/C: This parameter will tell the Registry Editor to re-establish the registry with the content in the specified.reg file.

If you want to re-establish the entire registry with the content in the file.reg file and save it to C:\Windows\System.dat and C:\Windows\Profiles\User.dat, you can execute the command: Regedit /L:C:\Windows\ /R:C:\Windows\Profiles\ /C file1.reg

Delete Registry Branch

This command can delete a subkey branch in the registry.
The command format is: Regedit /L:system /R:user /D Regpath

Parameter meaning:
/L: system specifies the path where the System.dat file is located.

/R: user specifies the path where the User.dat file is located.

/C: This parameter tells the Registry Editor to delete the registry subkey branch specified by Regpath.

Restore Registry

Scanreg.exe can check, back up, restore, and repair the registry. This command is stored in the "Windows\Command" directory.

Command format: Scanreg

Parameter meaning:
The /backup parameter is to back up the registry and related configuration files. These files are the four files System.dat, User.dat, Win.ini, and System.ini in the \windows directory respectively. These files are compressed into a rb???.cab file and stored in the \windows\sysbckup directory. Using this command multiple times will generate multiple CAB files, generally starting from 000. The system default maximum number of backups is 5. You can modify the maximum number of backups in the \Windows\scanreg.ini file. You can modify the value of "maxbackupcopies=?" to do this.

The /restore parameter is to select a backup to restore the registry. This command cannot be executed in Windows 98 environment. It must be turned off, restarted, and entered into pure DOS mode to run.

The /fix parameter is to repair the damaged registry. This command can only be run in DOS mode.

The /comment="" parameter is to add some detailed comments to the CAB file when backing up the registry.

To restore the damaged registry file, you can use the Scanreg command to repair it. The method is: first enter the DOS system operating environment, and then execute the following command: Scanreg/Restore

At this time, the system will prompt the registry backup situation, including the CAB file name and backup time, etc. The user can select the CAB file to be restored for recovery.

If you want to view all backup files and parts related to backup, you can execute the command: Scanreg /restore /comment

If there is a problem with the registry, you can use Scanreg to repair it. The command is: Scanreg /fix.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
gkf986512 +1 2008-05-23 23:15
http://dos.e-stone.cn/dosbbs
uploadImages/200311161145850422.swf
Floor 2 Posted 2009-03-05 02:22 ·  中国 江西 南昌 电信
新手上路
Credits 13
Posts 7
Joined 2009-02-23 20:02
17-year member
UID 139652
Gender Male
Status Offline
This is good.
Floor 3 Posted 2009-03-06 10:34 ·  中国 四川 德阳 电信
中级用户
★★
Credits 274
Posts 192
Joined 2009-01-07 21:09
17-year member
UID 136069
Gender Male
Status Offline
Good stuff. It is suggested that it should be highlighted.
Floor 4 Posted 2009-03-07 00:00 ·  中国 江苏 中移铁通
新手上路
Credits 16
Posts 8
Joined 2008-12-28 15:07
17-year member
UID 135166
Gender Male
Status Offline
Learning
Floor 5 Posted 2009-03-08 00:38 ·  中国 浙江 嘉兴 电信
新手上路
Credits 9
Posts 6
Joined 2008-09-24 17:11
17-year member
UID 126511
Gender Male
Status Offline
Oh, I see. Thank you. It's a very detailed tutorial.
Floor 6 Posted 2009-07-09 05:41 ·  中国 广西 柳州 联通
新手上路
Credits 6
Posts 3
Joined 2008-07-18 21:22
17-year member
UID 121691
Gender Male
Status Offline
The scanreg command was used in DOS of Win98 before. How to use it in XP system?
Floor 7 Posted 2009-08-06 12:33 ·  中国 江西 联通
新手上路
Credits 19
Posts 10
Joined 2009-07-07 04:31
16-year member
UID 148892
Gender Male
Status Offline
Nice stuff......
Floor 8 Posted 2009-08-09 10:38 ·  中国 四川 成都 电信
初级用户
Credits 64
Posts 32
Joined 2009-06-24 11:28
17-year member
UID 148063
Gender Male
Status Offline
That's a pretty good thing.
Floor 9 Posted 2009-08-12 13:01 ·  中国 江苏 徐州 沛县 电信
新手上路
Credits 8
Posts 4
Joined 2009-08-08 10:42
16-year member
UID 150055
Gender Male
Status Offline
Not bad, bad oh, he he
Floor 10 Posted 2009-09-30 17:38 ·  中国 湖北 天门 电信
中级用户
★★
Credits 208
Posts 135
Joined 2009-09-12 12:00
16-year member
UID 151902
From 离恨天
Status Offline
An old, familiar topic.
Floor 11 Posted 2009-10-12 18:04 ·  中国 内蒙古 呼和浩特 联通
新手上路
Credits 6
Posts 3
Joined 2009-10-08 13:26
16-year member
UID 152759
Gender Male
Status Offline
Learning
Floor 12 Posted 2009-12-02 14:17 ·  中国 山东 青岛 联通
新手上路
Credits 14
Posts 10
Joined 2009-12-01 21:49
16-year member
UID 155758
Gender Male
Status Offline
I still don't dare to mess with the registry casually
Floor 13 Posted 2009-12-03 19:37 ·  中国 宁夏 银川 电信
新手上路
Credits 14
Posts 7
Joined 2009-11-30 21:37
16-year member
UID 155691
Gender Male
Status Offline
Very detailed, thank you呵呵
Floor 14 Posted 2009-12-05 04:15 ·  中国 广东 东莞 电信
初级用户
Credits 29
Posts 17
Joined 2009-12-01 02:38
16-year member
UID 155707
Gender Male
Status Offline
:
However, there are so many sub-keys in the registry. Is there anyone who can give pointers on a quick way to distinguish the functions of each sub-key?
Floor 15 Posted 2009-12-05 17:04 ·  中国 甘肃 武威 电信
初级用户
Credits 50
Posts 26
Joined 2009-12-04 09:53
16-year member
UID 155891
Gender Male
Status Offline
I just knew the last one is scanreg/fix
Forum Jump: