Idefix
Idefix

Reputation: 15

AutoHotKey doesn't start program out of Visual Studio Code + AutoHotkey Extension

I want to make a script with Visual Studio Code and AHK that starts a certain program (automatically connect to a VPN ==> FortiClient).

If I double click directly on the script only containing that specific ahk run command in Windows Explorer, the client starts as desired. From Visual Studio code nothing happens.

I tried:

run, %programfiles%\Fortinet\FortiClient\FortiClient.exe

==> Works with double click from Windows explorer. Running from VS Code: nothing.

run, C:\Program Files\Fortinet\FortiClient\FortiClient.exe

==> Works with double click from Windows explorer. Running from VS Code: nothing.

I made a link to the exe an put that to a folder without a blank character in the directory name:

run, C:\Software_Checkout\AHK\FortiClient_Verknuepfung.lnk

==> Works with double click from Windows explorer. Running from VS Code: nothing.

What can be the reason for this?

Upvotes: 0

Views: 353

Answers (1)

hctiB elttiL
hctiB elttiL

Reputation: 16

I am unable to reproduce, so I'll give a dumb suggestion. Complete shot in the dark, but make sure you're not starting VS Code from under WSL. I've made that mistake in the past, the head scratches were plentiful. Other than that, I don't know what could be the issue. Maybe a faulty debugger?

Example script that works for me from VS Code, with several debuggers:

ProgramFilesX86 := A_ProgramFiles . (A_PtrSize=8 ? " (x86)" : "")
run %ProgramFilesX86%\Microsoft\Edge\Application\msedge.exe

Upvotes: 0

Related Questions