Friday, September 30, 2005
Modifying Registry Using MSH
MSH has a registry provider built-in. You can manipulate the registry just like you do with the file system. Here is an example session on modifying registry.
Note that in this example, I used the relative path. If you prefer the full path use HKLM:\SOFTWARE\mshtest instead of just mshtest.
MSH has a registry provider built-in. You can manipulate the registry just like you do with the file system. Here is an example session on modifying registry.
# Change to the HKLM\SOFTWARE key, note the ':'
# between HKLM and \SOFTWARE.
cd HKLM:\SOFTWARE
# Create a key HKLM\SOFTWARE\mshtest.
new-item mshtest
# Set a value for the key.
set-item mshtest -value TestValue
# Change the key value to DWORD type.
set-item mshtest -value 10 -type dword
# Create a new value mshvalue under the key.
set-property mshtest -property mshvalue -value value1
# Change the value to DWORD type.
set-property mshtest -property mshvalue -value 10 -type dword
# Delete the 'mshvalue' value.
remove-property mshtest -property mshvalue
# Delete the mshtest key.
remove-item mshtest
Note that in this example, I used the relative path. If you prefer the full path use HKLM:\SOFTWARE\mshtest instead of just mshtest.