[iLogic] Wait for a shell command to finish

[iLogic] Wait for a shell command to finish

amarcoc
Advocate Advocate
2,516 Views
1 Reply
Message 1 of 2

[iLogic] Wait for a shell command to finish

amarcoc
Advocate
Advocate

Hi. How can I wait for a Shell command to finish?

 

The point is to wait for a task to finish:

Call Shell(Command, vbHide)

Maybe I can use "Do" and "Loop"? But I dont know how 😕

 

I am currently using a 3 seconds pause after shell.

System.Threading.Thread.CurrentThread.Sleep(3000)

 

But I only want to wait the minimum time. Thanks.

 

 

0 Likes
Accepted solutions (1)
2,517 Views
1 Reply
Reply (1)
Message 2 of 2

amarcoc
Advocate
Advocate
Accepted solution

In case anyone needs the same, here is how I managed to do it:

 

Dim Sh, ReturnCode
Sh = CreateObject("WScript.Shell")
ReturnCode = Sh.Run("c:\teste\command.exe", 7, True)

Thanks!

0 Likes