中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-18 09:55
47,814 topics / 349,907 posts / today 0 new / 48,259 members
DOS学习入门 & 精彩文章 (教学室) » Repost: Using the Registry under DOS
Printable Version  5,554 / 16
Floor1 yiyesong Posted 2002-11-02 00:00
元老会员 Posts 632 Credits 1,987
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.
Floor2 gao Posted 2009-03-05 02:22
新手上路 Posts 7 Credits 13
This is good.
Floor3 wangfangjian Posted 2009-03-06 10:34
中级用户 Posts 192 Credits 274
Good stuff. It is suggested that it should be highlighted.
Floor4 wangfanlin Posted 2009-03-07 00:00
新手上路 Posts 8 Credits 16
Learning
Floor5 dosos Posted 2009-03-08 00:38
新手上路 Posts 6 Credits 9
Oh, I see. Thank you. It's a very detailed tutorial.
Floor6 mohaiyin Posted 2009-07-09 05:41
新手上路 Posts 3 Credits 6
The scanreg command was used in DOS of Win98 before. How to use it in XP system?
Floor7 a7147125 Posted 2009-08-06 12:33
新手上路 Posts 10 Credits 19
Nice stuff......
Floor8 lovehangain Posted 2009-08-09 10:38
初级用户 Posts 32 Credits 64
That's a pretty good thing.
Floor9 wjrzhi Posted 2009-08-12 13:01
新手上路 Posts 4 Credits 8
Not bad, bad oh, he he
Floor10 sfcctv Posted 2009-09-30 17:38
中级用户 Posts 135 Credits 208 From 离恨天
An old, familiar topic.
Floor11 lifeifei007 Posted 2009-10-12 18:04
新手上路 Posts 3 Credits 6
Learning
Floor12 kevinm Posted 2009-12-02 14:17
新手上路 Posts 10 Credits 14
I still don't dare to mess with the registry casually
Floor13 onlinepony Posted 2009-12-03 19:37
新手上路 Posts 7 Credits 14
Very detailed, thank you呵呵
Floor14 Sunjoy Posted 2009-12-05 04:15
初级用户 Posts 17 Credits 29
:
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?
Floor15 caimingbing Posted 2009-12-05 17:04
初级用户 Posts 26 Credits 50
I just knew the last one is scanreg/fix
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023