Search code examples
notepad++autohotkeynotepad

Why can't "Pause::Run notepad++ non_system_file" work?


How to run this command properly?

Pause::Run notepad++ D:\Data\Config\Essential.ahk

I get this error:

Error: Failed attempt to launch program or document:
Action: <notepad++ D:\Data\Config\Essential.ahk>
Params: <>

Specifically: The system cannot find the file specified.

Using Notepad++ for any key, or Pause key with notepad doesn't work. This doesn't involve system directories, as talked in this related question (Why does AutoHotkey respond with a "System cannot find the file" error?). Do you have any idea?

Full error:


Solution

  • AHK cannot know that "notepad++" is a program, if you don't use the .exe extension, therefore the error message "The system cannot find the file specified".

    Try also

    Pause::Run notepad++.exe D:\Data\Config\Essential.ahk
    

    or

    Pause::Run notepad++.exe "D:\Data\Config\Essential.ahk" ; more accurate syntax