Unicode 64

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
becritical
Posts: 15
Joined: 23 May 2016, 03:28

Unicode 64

15 Feb 2017, 02:56

In one of my scripts I have a call to nircmd.exe which I used to control my screen brightness. The only way to make it work is to use AHK in Unicode 64 mode. So I reinstalled it in U64 and the script works. The problem is that when I restart Windows the script does not work again, so I have to manually click on the script. I have my script loaded at startup with this script, so I think this is not loading the AHK unicode 64.
Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "C:\Users\Sir Punk\Documents\AutoHotkey.ahk" & Chr(34), 0
Set WshShell = Nothing

How can I solve this issue?

----------------
Guest

Re: Unicode 64

15 Feb 2017, 03:28

( This is not the forum section to Ask for Help. )

Look at your AutoHotkey folder, copy/rename the AutoHotkeyU64.exe to autohotkey.exe just to be sure you are always running the 64bit version.
becritical
Posts: 15
Joined: 23 May 2016, 03:28

Re: Unicode 64

15 Feb 2017, 04:56

I thought about that but maybe there was a proper way to do it. Anyway that works. thanks
becritical
Posts: 15
Joined: 23 May 2016, 03:28

Re: Unicode 64

09 Mar 2017, 13:08

I finally solved this by including the full path to the .exe. Apparently before he was working because he was in the same folder of the script.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Unicode 64

10 Mar 2017, 18:21

WshShell.Run chr(34) & "C:\Users\Sir Punk\Documents\AutoHotkey.ahk" & Chr(34), 0
This will always use the installed version of AutoHotkey.exe, so if you really did "reinstall it in U64", it will be 64-bit.
Apparently before he was working because he was in the same folder of the script.
Having a "U64" copy of AutoHotkey.exe in the same directory as the script won't make one iota of difference unless you're specifically running that AutoHotkey.exe (which then loads the script), not "running" the script itself.

If you run AutoHotkey Setup from the Start menu or Control Panel, you can change the default version associated with .ahk files without reinstalling. (You must click Apply after selecting the version.)
In one of my scripts I have a call to nircmd.exe which I used to control my screen brightness. The only way to make it work is to use AHK in Unicode 64 mode.
I think there's only one reason that could be: you've put nircmd.exe in the (64-bit) system32 directory. I suggest that you move it from there, since it's not a system file. The system redirects "system32" to "syswow64" in 32-bit processes.

If you need to run an executable from (or access a file in) the 64-bit system32 directory from a 32-bit script, you can replace "system32" with "SysNative". This is a standard Windows feature (from Vista onward) and only works in 32-bit processes.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, ShatterCoder and 142 guests