Passing an argument to a program

Discussion, questions and support.
Post Reply
Andyj
Posts: 3
Joined: Dec 17th, ’18, 23:48

Post by Andyj » Dec 17th, ’18, 23:55

Hi, I'm a new Fastkeys user and I'm trying to set up my start menu. I've created a number of menu items to start my favorite programs (using the run command) but some of these require an argument to do what I want. Normally I could type
"program.exe /argument1" but I cannot figure out how to do this in the start menu. Any help would be appreciated! Thanks.
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Dec 18th, ’18, 12:53

It should work the same as usual. In some specific cases you may try to enclose string is quotes:

Type: Run

Code: Select all

"program.exe /argument"
program.exe "/argument"
or Type: Command

Code: Select all

run, "program.exe /argument"
run, program.exe "/argument"
Andyj
Posts: 3
Joined: Dec 17th, ’18, 23:48

Post by Andyj » Dec 19th, ’18, 04:03

Thanks Marko! One of your options works for me. Much appreciated. Another question if you don't mind - can I run a command with admin privileges? And if so, how do I do this? Thanks again, Andrew
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Dec 20th, ’18, 08:15

Try (Type: Command)

Code: Select all

Run *RunAs program.exe
More information:
https://autohotkey.com/docs/commands/Run.htm
Andyj
Posts: 3
Joined: Dec 17th, ’18, 23:48

Post by Andyj » Dec 21st, ’18, 13:55

Thanks Marko! Fixed my problem and I'm now reading the reference guide...
Post Reply