You solution i find on this forum, but not ok.
Sorry, any variant not functioning:
hc.execute_and_wait('D:\\123\\WinContig\\WinContig.exe')
and my situation:
hc.execute_and_wait(hc.ini_path..'\\Utils\\WinContig\\WinContig.exe')
hc.execute_and_wait(hc.ini_path..'\Utils\\WinContig\\WinContig.exe')
hc.execute_and_wait(hc.ini_path..'Utils\\WinContig\\WinContig.exe')
Worked only:
hc.execute_and_wait('notepad.exe')
hc.execute_and_wait('notepad.exe' stat.txt)
hc.execute_and_wait('cmd.exe')
And not working:
hc.execute_and_wait('cmd.exe /C "D:\\123\\WinContig\\WinContig.exe"')
hc.execute_and_wait('cmd.exe /C D:\\123\\WinContig\\WinContig.exe')
hc.execute_and_wait('cmd.exe'..[[/C "D:\123\WinContig\WinContig.exe]])
hc.execute_and_wait('start "" /wait "D:\\123\\WinContig\\WinContig.exe"')
I tested so of any other (exe) programs with same problem.
LOG is clear.
Solving solution is only this:hc.execute_and_wait('cmd.exe'..[[ /C ]]..[["]]..hc.ini_path..[[Utils\WinContig\WinContig.exe"]])
...this variant have problem where is window show.
execute_and_wait not have param as SW_HIDE.
hc.execute_and_wait('cmd.exe'..[[ /C ]]..[["]]..hc.ini_path..[[Utils\WinContig\WinContig.exe"]], SW_HIDE)
mai62, do you can add this param for this function?(WinContig have param for hide window /NOGUI but short flash window if start (programs for hide running flashing too - as nircmd exec hide))
Working alternative for hide window (every 1 sec. check running process):
hc.shell_execute([["]]..hc.ini_path..[[Utils\WinContig\WinContig.exe]]..[["]], [["]]..hc.cache_path..[[" /DEFRAG /NOPROMPT /NOSCROLL /CHKDSK:0 /CLEAN:0 /NOGUI]], nil, 'SW_HIDE')
os.remove(hc.cache_path..[[tmp.txt]])
hc.sleep(1000)
while true do
hc.shell_execute([[cmd]], [[/C tasklist /NH /FO CSV /FI "IMAGENAME eq WinContig.exe">"]]..hc.cache_path..[[tmp.txt"]], nil, 'SW_HIDE')
hc.sleep(1000)
local f = io.open(hc.cache_path..[[tmp.txt]], "r")
local content = f:read()
f:close()
if content == [[INFO: No tasks are running which match the specified criteria.]] then
os.remove(hc.cache_path..[[tmp.txt]])
break
end
end