1. keywords and values for reading the registry:
You can pass the complete keyword path to the regread method of the wshshell object. For example:
CopyCode The Code is as follows: Set Ws = wscript. Createobject ("wscript. Shell ")
V = ws. regread ("HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run \ nwiz ")
Wscript. Echo v
2. Write the Registry
Use the regwrite method of the wshshell object. Example:Copy codeThe Code is as follows: Path = "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run \"
Set Ws = wscript. Createobject ("wscript. Shell ")
T = ws. regwrite (Path & "JJ", "hello ")
In this way
The HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run \ JJ key value is changed to hello. However, note that this key value must exist in advance.
This method is also used to create a new keyword.Copy codeThe Code is as follows: Path = "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run \ sssa2000 \ love \"
Set Ws = wscript. Createobject ("wscript. Shell ")
Val = ws. regwrite (path, "nenboy ")
Val = ws. regread (PATH)
Wscript. Echo Val
Delete keywords and values
Use the regdelete method to pass the complete path to regdelete.
For example
Val = ws. regdel (PATH)
Note: If you want to delete the keyword value, you must add "\" at the end of the path. If you do not add a slash, the entire keyword will be deleted.
Of course, from the current perspective, it may be better to use the WMI registry processing function.