Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
C:\Program Files (x86)\DotR\DotR.exe

I know I need to escape the backslashes like C:\\Program Files (x86)\\DotR\\DotR.exe but it still doesn't work. Do I need to handle spaces and parens as special characters and if so, how?

Edit with details: I'm running a small console application from the context menu. When I save it to C:\DotR.exe and add to HKEY_CLASSES_ROOT\Folder\shell\DotR\ the value C:\\DotR.exe %1 it works fine but when I try to make it C:\\Program Files(x86)\\DotR\\DotR.exe %1 I get an error message that says application not found. I want to save it in program files and not C root.

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

How exactly are you trying to add it?

I suspect your primary problem is that you need quotes around the name.

"C:\Program Files (x86)\DotR\DotR.exe" %1

If you are adding the value by using the regedit.exe GUI editor, as a string value, then you do not need to escape the \ or the " characters. The GUI will handle the escaping, you just need to add the quotes.

If you are adding it with a .reg file then it \ characters do need to be escaped, you also need to escape the " character. So a REG_SZ value of "c:\asdf\asdf" would look like this.

[HKEY_CURRENT_USER\Temp]
"asdf"="\"c:\\asdf\\asdf\""
share|improve this answer
    
I was using regedit. The quotes worked, thanks. –  pdizz Sep 24 '12 at 20:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.