Link to home
Start Free TrialLog in
Avatar of SDJ_1
SDJ_1

asked on

Delete Registry Value

I'm running the following command in my .cmd file to delete a registry key:

reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders /v "C:\Program Files\Symantec\Critical System Protection\" /f

The /f switch is suppose to force delete without prompting but it's not doing that,  still getting the following message:

Delete the registry value C:\Program Files\Symantec\Critical System Protection"
/f (Yes/No)?

When I manually select Yes  I get message:

ERROR: The system was unable to find the specified registry key or value.

Can someone please tell me where I'm going wrong with this.

Windows Server 2003


Thanks
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

/v should be the name of the subkey . . . not the data within.

(EG: in the right window, under the name column, not the data column)

that should handle the error.

have you tried without the quotes?
Avatar of SDJ_1
SDJ_1

ASKER

Yes, tried without the quotes and getting error message:

ERROR: Invalid syntax.
try:
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders" /v "C:\Program Files\Symantec\Critical System Protection\" /f
Avatar of SDJ_1

ASKER

Thanks.  That option did not work still prompting if I want to delete:

Delete the registry value C:\Program Files\Symantec\Critical System Protection"
/f  (Yes/No)? y
ERROR: The system was unable to find the specified registry key or value.
can you post a screen shot of the registry key for that.
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SDJ_1

ASKER

wow ok that did it!  Thanks a lot!
After thinking about this a bit more and for anyone else coming across this the \" might be interpreted as a single " in DOS.

It has to do with the escape characters:
http://www.robvanderwoude.com/escapechars.php

It's interesting that you only have to do this at the end.

I tried C:\\Program Files\\ in a test which didn't work.  Just need it at the end.  

Glad it worked.