PowerShell for Windows Admins

Jul 24 2010   7:27AM GMT

Remove-RegValue



Posted by: Richard Siddaway
Tags:
PowerShell v2
Registry

Removing a registry value is a matter of using the DeleteValue() method

001
002
003
004
005
006
007
008
009
$HKLM = 2147483650 #HKEY_LOCAL_MACHINE

$computer = "."  #local machine
$reg = [wmiclass]"\\$computer\root\default:StdRegprov"

$key = "SOFTWARE\ITKE PSAdmins"
$value = "String Entry"

$reg.DeleteValue($HKLM, $key, $value)

Set the hive, the key and the value and call the method

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: