cblock1025
Technical User
I hope there is someone that can help out a bit. I am out of ideas here.
This is the problem:
I have a .exe application, and I need to know when it is finished in order to execute another command, which in my case is a reboot. However, here is the tricky part. My executable actually starts up a run process to connect and then another which is the application itself. First it starts a process called "pn.exe" once it connects(about 3 seconds) it then runs a process called "wfica32.exe". Now, my problem is that I need to make sure the wfica32.exe finishes before executing the following line of code(which is a reboot). Here is how I start the program up.
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\progra~1\citrix\icacli~1\pn.exe /APP
desktop", 1, True
Set WshShell = Nothing
I have tried a wait command, but what happens is that it only thinks the .exe is kicking off only one process, so it doesn´t care about the other process and decides to go to the next line of code.
I have been trying to catch the process with:
set service = GetObject ("winmgmts:")
for each Process in Service.InstancesOf ("Win32_Process")
However, I really don't have an idea, how i can tell it when the process ended (wfica32.exe) to kick the next line of code.
Help would really be a blesing.
Thanks guys
Christian
This is the problem:
I have a .exe application, and I need to know when it is finished in order to execute another command, which in my case is a reboot. However, here is the tricky part. My executable actually starts up a run process to connect and then another which is the application itself. First it starts a process called "pn.exe" once it connects(about 3 seconds) it then runs a process called "wfica32.exe". Now, my problem is that I need to make sure the wfica32.exe finishes before executing the following line of code(which is a reboot). Here is how I start the program up.
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "c:\progra~1\citrix\icacli~1\pn.exe /APP
desktop", 1, True
Set WshShell = Nothing
I have tried a wait command, but what happens is that it only thinks the .exe is kicking off only one process, so it doesn´t care about the other process and decides to go to the next line of code.
I have been trying to catch the process with:
set service = GetObject ("winmgmts:")
for each Process in Service.InstancesOf ("Win32_Process")
However, I really don't have an idea, how i can tell it when the process ended (wfica32.exe) to kick the next line of code.
Help would really be a blesing.
Thanks guys
Christian