How to launch a program or open a folder?

Announcements, questions
Post Reply
Frostea
Posts: 1
Joined: 01 May 2019, 08:58

How to launch a program or open a folder?

Post by Frostea » 01 May 2019, 09:09

Hello, I just got this yesterday and have been having fun tinkering.

I can't figure out how to open programs. I know from the sample that lmc_spawn("calc") will open the calculator. But how do I open something like Firefox or Chrome? I've tried things like lmc_spawn("browser") and lmc_spawn("firefox") but neither worked.

On a similar note, can luamacros be used to open specific folders? For example, press a key to open the AppData\Local folder.

Thanks for any help.

admin
Site Admin
Posts: 605
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: How to launch a program or open a folder?

Post by admin » 02 May 2019, 08:07

You need to know the program (exe file) name and sometimes even path and pass it as argument to lmc_spawn (note that calculator is in fact program calc.exe).
Opening folder usually means you are in fact running windows explorer program with path to the folder as argument. Again you need to find out what is the exe file.
Petr Medek
LUAmacros author

Dnarte
Posts: 1
Joined: 21 Sep 2019, 07:16

Re: How to launch a program or open a folder?

Post by Dnarte » 21 Sep 2019, 07:25

I've got it, so to launch a program you would want to do
lmc_spawn ("explorer" ,

that is your file explorer which is necessary, to open a program you would need to do the path to the folder that also contains the name of the exe which would look like
lmc_spawn ("explorer" , "C:\\Users\\Billy\\Desktop\\obs64.lnk")
The reason I use shortcut links is because some programs don't open properly unless you do that. And it goes the same for internet links but the extension for the shortcut would be .url .

Post Reply