DarrellBlack
02-15-2005, 08:45 AM
Is there a way to wait for the return of shell.execute before moving on?
I am sure everyone has needed this, so it must be easy to trap for but I can't find any example code. I want to be able to use checkboxes to pick what options to run (on shutdown) then run them in order. The code is all in place but my software uses a serial port, therefore one session must be complete before the next one starts. I do not want to use sleep or delays I want to wait for positive feedback that the first job is done before launching another.
Here is my code:
if (RACKSLOT1D) then
Shell.Execute(SessionVar.Expand("%AppFolder%\\firmware\\fwloader.exe"), "open", "/firmtype DIM /serial "..sRACKNUMBER.." /connection serial /port "..sCOMPORT.." /firstslot 1 /lastslot 1 /filename tdas3_dim_256_hw127_v0100.ahx /quit Y", "%AppFolder%\\firmware", SW_SHOWNORMAL);
end
if (RACKSLOT1S) then
Shell.Execute(SessionVar.Expand("%AppFolder%\\firmware\\fwloader.exe"), "open", "/firmtype SIM /serial "..sRACKNUMBER.." /connection serial /port "..sCOMPORT.." /firstslot 1 /lastslot 1 /filename tdas3_sim_256_hw127_v07e4.ahx /quit Y", "%AppFolder%\\firmware", SW_SHOWNORMAL);
end
if (RACKSLOT1T) then
Shell.Execute(SessionVar.Expand("%AppFolder%\\firmware\\fwloader.exe"), "open", "/firmtype TOM /serial "..sRACKNUMBER.." /connection serial /port "..sCOMPORT.." /firstslot 1 /lastslot 1 /filename tdas3_tom_256_v01c6.ahx /quit Y", "%AppFolder%\\firmware", SW_SHOWNORMAL);
end
I am sure everyone has needed this, so it must be easy to trap for but I can't find any example code. I want to be able to use checkboxes to pick what options to run (on shutdown) then run them in order. The code is all in place but my software uses a serial port, therefore one session must be complete before the next one starts. I do not want to use sleep or delays I want to wait for positive feedback that the first job is done before launching another.
Here is my code:
if (RACKSLOT1D) then
Shell.Execute(SessionVar.Expand("%AppFolder%\\firmware\\fwloader.exe"), "open", "/firmtype DIM /serial "..sRACKNUMBER.." /connection serial /port "..sCOMPORT.." /firstslot 1 /lastslot 1 /filename tdas3_dim_256_hw127_v0100.ahx /quit Y", "%AppFolder%\\firmware", SW_SHOWNORMAL);
end
if (RACKSLOT1S) then
Shell.Execute(SessionVar.Expand("%AppFolder%\\firmware\\fwloader.exe"), "open", "/firmtype SIM /serial "..sRACKNUMBER.." /connection serial /port "..sCOMPORT.." /firstslot 1 /lastslot 1 /filename tdas3_sim_256_hw127_v07e4.ahx /quit Y", "%AppFolder%\\firmware", SW_SHOWNORMAL);
end
if (RACKSLOT1T) then
Shell.Execute(SessionVar.Expand("%AppFolder%\\firmware\\fwloader.exe"), "open", "/firmtype TOM /serial "..sRACKNUMBER.." /connection serial /port "..sCOMPORT.." /firstslot 1 /lastslot 1 /filename tdas3_tom_256_v01c6.ahx /quit Y", "%AppFolder%\\firmware", SW_SHOWNORMAL);
end