In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to program the registry under DOS. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.
Can you program the registry in DOS mode? Right. When your Windows95/98 cannot start to the graphical interface because of a registry problem, you can only operate on the registry under DOS at this time. Because the registry editor Regedit.exe is actually an amphibious program that can be run either under DOS or under Windows95/98. Many users may already know how to use Regedit under Windows, so to master the programming of registry in DOS mode, you must first understand how to use Registry Editor under DOS.
Type the Regedit command at the DOS prompt and a help screen appears. This screen gives its command-line parameters and how to use them.
Syntax: Regedit [/ L:system] [/ R:user] filename1
Regedit [/ L:system] [/ R:user] / C filename2
Regedit [/ L:system] [/ R:user] / E filename3 [regpath]
Where:
/ L:system specifies the location where the system.dat file is stored.
/ R:user specifies the location where the user.dat file is stored.
Filename1 specifies the file name that is brought into the registry database.
/ C filename2 specifies the file name that forms the registry database.
/ E filename3 specifies the file name of the exported registry file.
Regpath specifies the start keyword for exporting the registry file (default is all keywords)
Here are several examples to illustrate the use of regedit.exe under DOS.
[example 1] Export the system registry database registry to a reg1.reg file.
Regedit / E reg1.reg
[example 2] reg1.reg forms the system registry database registry (all).
Regedit / C reg1.reg
[example 3] introduce reg.dat into the system registry database (part).
Regedit reg.dat
[example 4] export the keyword starting from CJH to the registry database and name it cjh.reg.
Regedit / E cjh.reg cjh
[example 5] specify that system/dat is stored in D:\ PWIN and user.dat in E:\ PWIN to form a new registry database registry.
Regedit / LRV D:\ PWIN / RVR E:\ PWIN / C reg.dat
With all this knowledge, combined with the registry files (* .Reg) about import or export mentioned in "shortcuts to programming the registry", we can program the registry in DOS mode.
Let's take changing the default opening mode of "* .txt" file-"notepad" to "WordPad" as an example. First export the branch of the "HKEY_CLASSES_ROOT\ txtfile" subkey at the MS-DOS prompt, that is, execute the command:
Regedit / E txt.reg HKEY_CLASSES_ROOT\ txtfile
Then use the EDIT editor under DOS to open the txt.reg file for editing: change all "C:\\ WINDOWS\\ NOTEPAD.EXE" to "C:\\ WINDOWS\\ WRITE.EXE", save the disk and exit EDIT, and execute the command under the command line:
Regedit txt.reg
And it's done.
Of course, strictly speaking, this is not programming. If we have to implement it programmatically, we can write the above process as a batch processing file chang.bat:
@ echo off
Path=c:\ windows;c:\ windows\ command;c:\ dos
Cls
Echo is exporting the registry.
Regedit / E txt.reg HKEY_CLASSES_ROOT\ txtfile
Echo.
Echo registry export is complete! Press any key to start editing the registry.
Echo.
Pause
Edit txt.reg
Echo is importing the modified registry.
Regedit txt.reg
Echo, congratulations! Successfully modified the registry in MS-DOS mode!
Pause
Cls
@ echo on
To give full play to the powerful function of the EDIT editor, we can modify, delete or add any subkey to the registry at will on the premise of following the format of the exported registry file. If you feel that this is not programmatic enough, you can give full play to the advantages of various programming languages in the DOS environment, coupled with an interactive interface, so that the real programming of this process should be no less than the effect of using API functions in Windows.
The above is all the contents of the article "how to program the registry under DOS". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.