Ooker
Ooker

Reputation: 3042

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:

Upvotes: 1

Views: 419

Answers (2)

Jim U
Jim U

Reputation: 3366

Is "notepad++.exe" in your path?

Try specifying the full path to notepad++.exe and see if that fixes it:

Pause::run "C:\Program Files (x86)\Notepad++\notepad++.exe" D:\Data\Config\Essential.ahk

NOTES:

  • make sure notepad++.exe is installed in the above directory
  • you can locate notepad++.exe by opening a command prompt and running cd \ && dir notepad.exe /s
  • Use a command prompt and enter set path to see if notepad++.exe's directory is in your path

Upvotes: 2

Relax
Relax

Reputation: 10603

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

Upvotes: 0

Related Questions