pass parameter to executable Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
CyberKlabauter
Posts: 44
Joined: 26 Jan 2017, 17:59

pass parameter to executable

26 Jan 2017, 18:16

I want to pass parameters to the ahk v2 script. But there is a weird behavior:

Code: Select all

MsgBox,,,%1%
var := "%1%"
MsgBox,,,%var%
This script is called like "script.exe hello_world".

%1% is not equal to %var%. What would be the right syntax for

Code: Select all

var := "%1%"
if I would like to assign the passed parameter to var? Seems to be easy, but I am failing.
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: pass parameter to executable

26 Jan 2017, 19:12

Try this:

Code: Select all

MsgBox,,, % A_Args[1]
var := A_Args[1]
MsgBox,,,%var%
I hope that helps.
CyberKlabauter
Posts: 44
Joined: 26 Jan 2017, 17:59

Re: pass parameter to executable  Topic is solved

27 Jan 2017, 04:01

Than you, that helped! Didn't work for me direcly, but was the right hint. Here the solution that worked: http://goo.gl/JfMNpN

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: NPerovic, Panaku, songdg and 46 guests