Modify

New-Item -Path Registry::HKLM\Software\MyKey

Create registry key

reg add HKLM\Software\MyKey /v MyValue /t REG_SZ /d "Data"

Add registry key

Set-ItemProperty -Path Registry::HKLM\Software\MyKey -Name <Name> -Value "Data"

Set key value

Set-ItemProperty -Path dwm -PSProperty EnableAeroPeek -Value 0

Set EnableAeroPeek to 0

reg delete HKLM\Software\MyKey /v MyValue

Delete registry key or value

Remove-Item -Path Registry::HKLM\Software\MyKey

Delete registry key and its subkeys in PowerShell

Remove-ItemProperty -Path Registry::HKLM\Software\MyKey -Name MyValue

Delete registry value

reg copy HKLM\Software\MyKey HKLM\Software\NewKey

Copy registry key and its subkeys to a new location

reg import filename.reg

Imports registry settings

reg export HKLM\Software\MyKey filename.reg

Exports registry key and its subkeys

reg save HKLM\Software\MyKey filename.hiv

Saves a registry key and its subkeys in Hive (HIV) format

reg load HKLM\TempKey filename.hiv

Loads a Hive (HIV) file into the registry

reg unload HKLM\TempKey

Unloads a previously loaded Hive (HIV) file from the registry

Create the value Test in the RunOnce subkey of HKLM using the following command:

reg add hklm\software\microsoft\windows\currentversion\runonce /v Test /t REG_BINARY /d 1111

Modify the binary value of Test using the following command:

reg add hklm\software\microsoft\windows\currentversion\runonce /v Test /t REG_BINARY /d 1111

Delete the binary value for Test using the following command:

reg delete hklm\software\microsoft\windows\currentversion\runonce /v Test

Last updated

Was this helpful?