Go to the Windows registry in a DOS environment

Source: Internet
Author: User


Registry Editor can run not only in windows, but also in MS-DOS real mode. Sometimes when the registry is damaged and Windows cannot be started, we only need to repair or modify the Registry in DOS mode. The actual physical files of the Registry are system. dat and user. dat, which means that the data in the registry is stored in these two files.

Export Registry

This command backs up the Registry file.

Command Format: Regedit/L: System/R: User/e filename. Reg regpath

Parameter description:

/L: system specifies the path of the system. dat file.

/R: User specifies the path of the user. dat file.

/E: this parameter specifies that the Registry Editor needs to export the Registry. If this parameter is left blank, enter the file name of the exported registry.

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

If you want to save it in C: \ WINDOWS \ SYSTEM. dat and stored c: \ windows \ profiles \ User. all branches under the root key of hkey_classer_root In dat are exported 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 description:

/L: system specifies the path of the system. dat file.

/R: User specifies the path of the user. dat file.

Rebuild Registry

Rebuild the registry, that is, re-create the system. dat and user. DAT files.

Command Format: Regedit/L: System/R: User/C file. Reg

Parameter description:

/L: system specifies the path of the system. dat file.

/R: User specifies the path of the user. dat file.

/C: This parameter tells the Registry Editor to re-create the Registry with the content in the specified. reg file.

If you want to use file. rebuild the entire registry in the reg file and save it to C: \ WINDOWS \ SYSTEM. dat and c: \ windows \ profiles \ User. dat, the executable command: Regedit/L: C: \ WINDOWS \/R: C: \ WINDOWS \ profiles \/C file1.reg

Delete A registry Branch

This command can delete a subkey branch in the registry.

Command Format: Regedit/L: System/R: User/d regpath

Parameter description:

/L: system specifies the path of the system. dat file.

/R: User specifies the path of the user. dat file.

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

Restore the Registry

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

Command Format: scanreg [/<option>]

Parameter description:

The/backup parameter is used to back up the registry and related configuration files. These files \ System under the Windows directory. dat, user. dat, win. INI, system. INI files, which are compressed into RB --?. A cab file is stored in the \ windows \ sysbckup directory. Multiple CAB files are generated when you use this command multiple times. Generally, from 000, the maximum number of backups is 5 by default. You can modify the maximum number of backups in the \ windows \ scanreg. ini file by modifying "maxbackupcopies = ?" .

The/restore parameter selects a backup to restore the Registry. This command cannot be executed in Windows 98. It must be shut down and restarted to run in pure DOS mode.

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

The/comment = "<comment>" parameter adds detailed comments to the cab file when backing up the registry.

To restore a corrupted registry file, run the scanreg command to restore the file. First, go to the DOS operating environment and run the following command: scanreg/restore

The system will prompt the Registry backup status, including the cab file name and backup time. You can select the cab file to be restored for restoration.

To view all backup files and backup-related parts, run the following command: scanreg/restore/comment.

If the registry is faulty, use scanreg to fix it. The command is scanreg/fix.

Supplement:
// Help information. You can delete the previous "//" symbol when using it. It is best to pass the local test first.
// Regedit.exe-e reg1.txt HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run
// Regedit.exe-e reg2.dll "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server \ winstations \ RDP-TCP"
// Export the Registry content above
// Regedit.exe-s reg2.dll
// The Registry content is imported above, and no message is displayed. reg1.dll must be in a valid format.
//____________________________________________________________________________
/// Win98 Registry File Header Format
// Regedit4
//
//// Win2000/XP/NT Registry File Header Format (empty line)
//_____________________________________________________________________________
// Windows Registry Editor Version 5.00
//
// [HKEY_LOCAL_MACHINE \ SOFTWARE \ test4adam]
// "Test1" = "Adam"
// "Test2" = HEX: 61
// "Test3" = DWORD: 00000064
// The test1 type is "string value"
// The Test2 type is "binary value"
// The test3 type is "DWORD Value"

// Delete a project name
// [HKEY_LOCAL_MACHINE \ SOFTWARE \ test4adam]
// "Test1" =-

// Delete a subitem
// [-HKEY_LOCAL_MACHINE \ SOFTWARE \ test4adam]

// Reg.exe query "HKLM \ System \ CurrentControlSet \ Control \ Terminal Server \ winstations \ RDP-Tcp \ portnumber"
// Reg.exe query "HKLM \ System \ CurrentControlSet \ Control \ Terminal Server \ WDS \ rdpwd \ TDS \ Tcp \ portnumber"
// The following parameters have spaces. Therefore, double quotation marks must be used.

// The following is the tool in win2000kit.
// E: \ scanreg. EXE 1.05 <[-S] string> <[-K] [-V] [-D]> [[-R] Key] [-C] [-E] [- n]
// Examples: scanreg-s Windows-K-v-d
// Scanreg-s Windows-kvd
// Scanreg/s Windows/r \ lm \ Software/kvde
// Scanreg WINDOWS \ lm-KD-n
// Scanreg Windows \ moon \ HKEY_LOCAL_MACHINE-d
// Scanreg windows HKEY_CURRENT_USER \ Software-kvd

// ------------------------------------
/[HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Winlogon]
/"AutoAdminLogon" = DWORD: 00000001
// "defaultdomainname" = ""
// "DefaultUserName" = "Administrator"
// "defaultpassword" = "password"
/ /automatically log on to
// [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ ratings]
// "key" =-
// above delete the password for IE classified review
// [HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer]
// "norun" = DWORD: 00000001
// The project is not running
// [HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System]
/"disableregistrytools" = DWORD: 00000001
// 0x1 disable registry editing

// use the registry content of psu.exe
// pulist.exe | findstr.exe/I "Winlogon Explorer"
// obtain the corresponding Winlogon PID, if you log on to the terminal, the 212,788 is a valid PID.
// pulist.exe | findstr.exe/I "Winlogon Explorer"
// winlogon.exe 212 nt authority \ System
// assumer.exe 824 NETBAR-5G2JURY8 \ Administrator
// winlogon.exe 341 nt authority \ System
// winlogon.exe 788 nt authority \ System
// cycler.exe 1752 NETBAR-5G2JURY8 \ guest
// psu.exe-P "% WinDir % \ regedit.exe-s admg. reg "-I PID
// psu.exe-P" % WinDir % \ regedit.exe-e admin. reg HKEY_LOCAL_MACHINE \ SAM \ "-I PID
// psu.exe-P" % WinDir % \ regedit.exe-s admg. reg "-I 212 (used for telnet)
// psu.exe-P" % WinDir % \ regedit.exe-s admg. reg "-I 788 (used below cmd.exe)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.