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?
----------------
Unicode 64
-
- Posts: 15
- Joined: 23 May 2016, 03:28
Re: Unicode 64
( 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.
Look at your AutoHotkey folder, copy/rename the AutoHotkeyU64.exe to autohotkey.exe just to be sure you are always running the 64bit version.
-
- Posts: 15
- Joined: 23 May 2016, 03:28
Re: Unicode 64
I thought about that but maybe there was a proper way to do it. Anyway that works. thanks
-
- Posts: 15
- Joined: 23 May 2016, 03:28
Re: Unicode 64
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.
Re: Unicode 64
This will always use the installed version of AutoHotkey.exe, so if you really did "reinstall it in U64", it will be 64-bit.WshShell.Run chr(34) & "C:\Users\Sir Punk\Documents\AutoHotkey.ahk" & Chr(34), 0
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.Apparently before he was working because he was in the same folder of the script.
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.)
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.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.
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.
Who is online
Users browsing this forum: Chunjee, ShatterCoder and 142 guests