-1

i. Superstition: long file name (LFN) results in "file does not exist" error message.

ii. This is caused by a quotation error (see accepted answer*1)!

Reproducing:

Find "AutoHotKeyScript" in RegEdit and alter its sub-key Edit -> Command -> Default to ""C:\Program Files\Notepad++\notepad++.exe" %1".

Right-click and click 'edit' in my context menu to open a file in notepad++.

If you're in a directory with a very long name such as ...Program Files\myfile.txt, the file will not be opened, and the error will come up: "...Program, file does not exist. Create it?".

3

This problem occurs because %1 must be put in quotation marks. In fact, this problem only happens with directory names have spaces in them: it has nothing to do with the length of the path.

Similarly, when editing registry items for file associations, context menu, shell, or shellex, use "%path-to-program%" "%1" (with quotes) rather than %1.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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