As a follow up, I feel my Windows Script Host is probably really misconfigured. In the registry the default for HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command is set to
Code: Select all
"%SystemRoot%\System32\WScript.exe" "%1" %*
and HKEY_CLASSES_ROOT\VBSFile\Shell\Open2\Command is set, as you might expect, to
Code: Select all
"%SystemRoot%\System32\CScript.exe" "%1" %*
in the registry.
On my system the 32-bit AutoHotkey.dll seems to be working from VBS, only if I call it with the SysWOW64 wscript or cscript. (I'm assuming the 32-bit version of cscript can't call the 64-bit AHK DLL.) But using the System32 cscript yields this:
Code: Select all
[Window Title]
Microsoft ® Console Based Script Host
[Main Instruction]
Microsoft ® Console Based Script Host has stopped working
[Content]
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
[Debug] [Close program]
This script runs fine with AHK_L 32-bit and AHK_L 64-bit, so I'm assuming my AutoHotkey DLLs are both registered:
Code: Select all
ahk:=ComObjCreate("Autohotkey.Script")
ahk.ahktextdll("")
Sleep 100
ahk.addScript("Func(a="""",b=""""){`nMsgBox % a ""``n"" b`n}")
ahk.ahkFunction("func","test1", "test2")
MsgBox Ende
but apparently I'm not getting the 64-bit dll to run with CScript or VBScript.