for exmpaple
lmc_spawn("nircmd","mutesystemsound 2")
i only got a nircmd default window(the window you click the nircmd.exe without any parameter)
,it won't run the parameter(mtuesystemsound 2)
i tired different parameter,won't work.
but everything else works fun(notepad ,cmd and so on)
the only solution is lmc_spawn("cmd","/c nircmd mutesystemsound 2")
but will create a flash cmd window,that's annoyed
win7 x64
lmc_spawn cant run Nircmd with parameter
Re: lmc_spawn cant run Nircmd with parameter
Seeing relevant part of source code maybe number 2 makes the trouble as lua identifies the type as number, not string.
I should extend this condition to fix it.
Maybe (to speed thing up) you can do some additional testing with number arguments and different programs. If this is really root cause then any numeric argument should fail (be filtered out) for any program.
I should extend this condition to fix it.
Maybe (to speed thing up) you can do some additional testing with number arguments and different programs. If this is really root cause then any numeric argument should fail (be filtered out) for any program.
Petr Medek
LUAmacros author
LUAmacros author
Re: lmc_spawn cant run Nircmd with parameter
Try to pass multiple parameters like that:
function nircmd(cmd, param1, param2, param3, param4)
lmc_spawn("nircmd", cmd, param1, param2, param3, param4)
end
follow a example of how to call it:
function tooltip(msg)
nircmd("trayballoon", "LuaMacros", msg, "imageres.dll,76", 1)
end
Did you get it? lmc_spawn accepts as much parameters as is needed to run the program
function nircmd(cmd, param1, param2, param3, param4)
lmc_spawn("nircmd", cmd, param1, param2, param3, param4)
end
follow a example of how to call it:
function tooltip(msg)
nircmd("trayballoon", "LuaMacros", msg, "imageres.dll,76", 1)
end
Did you get it? lmc_spawn accepts as much parameters as is needed to run the program
Re: lmc_spawn cant run Nircmd with parameter
btw, it works well if you pass nothing or less parameters as well, like follow:
function desktop_left()
nircmd("sendkeypress", "ctrl+lwin+left")
end
looks like nil parameters are ignored by lua and by the luamacros interpreter
function desktop_left()
nircmd("sendkeypress", "ctrl+lwin+left")
end
looks like nil parameters are ignored by lua and by the luamacros interpreter