reg delete /f

Today, I have one problem … very strange problem and I didn’t find solution on Internet.

Have you ever try to use reg delete KeyName /v and to add /f switch?

I think it’s not possible in Windows XP?!

My solution is …
Use VB script to do that:

‘– script begin —
Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = “.”

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!” & _
strComputer & “rootdefault:StdRegProv”)

strKeyPath = “your_path – ex. SYSTEMControlSet001 …”
strDWORDValueName = “Value that you want to delete”

oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strDWORDValueName

MsgBox “The End”

‘– script end –