"C:\Program\ is not recognized ...command" Error

The popular SciTE-based AutoHotkey Script Editor
ChrisOwl
Posts: 23
Joined: 20 Oct 2020, 12:59

"C:\Program\ is not recognized ...command" Error

Post by ChrisOwl » 02 Dec 2020, 12:35

I'm getting this issue whenever I use SciTE4AHK:

"C:\Program Files\SciTE\..\AutoHotkey.exe" /ErrorStdOut "C:\Users\s_man\Dropbox\AHK\test1.ahk"

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Exit code: 1 Time: 0.2442


I can open the same AHK file and run it on other AHK editor interfaces, but it always fails with SciTE.

When I make a brand new basic program in SciTE it still fails.

Any ideas?

pplatinumss
Posts: 7
Joined: 08 Apr 2019, 16:40

Re: "C:\ Program\ is not recognized ...command" Error

Post by pplatinumss » 28 Jul 2022, 13:02

same, just installed the beta 2 yesterday. Wonder what is wrong

User avatar
dJeePe
Posts: 20
Joined: 21 Oct 2022, 08:53

Re: "C:\Program\ is not recognized ...command" Error

Post by dJeePe » 27 Oct 2022, 12:09

Same error here
Although the text of the error is not at all explicit i had manually modify the file ahk.properties to indicate the name of the autohotkey executable (which is AutoHotkeyU64.exe in my case)

Code: Select all

AutoHotkey=$(AutoHotkeyDir)\AutoHotkeyU64.exe

Abajur Voador
Posts: 1
Joined: 08 Jan 2023, 09:04

Re: "C:\Program\ is not recognized ...command" Error

Post by Abajur Voador » 08 Jan 2023, 12:55

dJeePe wrote:
27 Oct 2022, 12:09
Same error here
Although the text of the error is not at all explicit i had manually modify the file ahk.properties to indicate the name of the autohotkey executable (which is AutoHotkeyU64.exe in my case)

Code: Select all

AutoHotkey=$(AutoHotkeyDir)\AutoHotkeyU64.exe


This solution was outdated for me, but after much frustration muddling through I could figure it out!

Understanding The problem:
When you try to run a script through SciTE4AutoHotkey, SciTE searches your AutoHotkey install folder for the .exe file it needs to run.
The problem being that SciTE can't find this file because newer versions of AutoHotkey changed both the name of the .exe files and the folder where it is located.
Note: In the future, if newer updates to AutoHotkey ever change the paths to the .exe files or alter their names, you could easily update this solution to reflect these changes.


SOLUTION:



OPTION #1: - it is IDEAL because it fixes the problem for all users (but requires admin privileges)

Find the file "ahk.properties" inside the SciTe folder and open it with notepad.
By default, SciTe installs itself inside the AutoHotkey install folder, so the path to this file should be something like "C:\Program Files\AutoHotkey\SciTE\ahk.properties"

In the 14th line of the ahk.properties file you should FIND this written:

AutoHotkey=$(AutoHotkeyDir)\AutoHotkey.exe


REPLACE IT with any ONE of the following ALTERNATIVES, depending on which version of AutoHotkey you wish to run (any of them should work):

AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey32.exe
OR
AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey64.exe
OR
AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey64_UIA.exe
OR
AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey32_UIA.exe


Just save these changes (admin privileges required to save) and it's fixed!




OPTION #2: - if you don't have admin privileges, you can fix the problem (but only for your current user profile in windows):

- Open the SciTE app window
- Click the "Options" drop menu then select "Open User Properties"; a new tab should open: "SciTEUser.properties"
- Under " # Add here your own settings " you should copy and paste ONE of the following ALTERNATIVES, depending on which version of AutoHotkey you wish to run:

AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey32.exe
OR
AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey64.exe
OR
AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey64_UIA.exe
OR
AutoHotkey=$(AutoHotkeyDir)\v2\AutoHotkey32_UIA.exe


Just save changes. Exit and re-open SciTE to apply the changes and... Problem solved!

Post Reply

Return to “SciTE4AutoHotkey”