Vbscript call exe and wait
Use Run instead. For Windows 9x users, command. It will call the correct version of CMD. After calling the command-line, it will read the output in real-time and write changes on the same window of our script.
When the program closes, VBScript will read all output from the prompt and write it on screen. Start-Sleep came to mind as the next command to add, then have it loop back to Wait-Process, but 2 problems with that:.
If I create a step before the Wait-Process line to check that the process exists first to prevent a endless loop , still a chance 1 could occur. Is there a way to add a delay that resets if the process starts again to Wait-Process similar to the -Timeout parameter? Spent some more time on it. Mostly because the base script I had created wouldn't work with my processes.
Still have the same problem. The Radpinit process seems to start and stop frequently, and there is a slight delay before it starts, so I added a pause. But the Wait-Process still ends as soon as the first instance end. If you are tryingto mage installer processes you cannot do it by a script. The installer runs under the system installer service. The exe or msi file just causes a call to the installer and gives it the file name and the options then quits.
An MSI or setup. You can only communicate with what is happening by embedding a special script inside the installer process. This issue come up repeatedly in this and other forum. The answer has always been to either create custom installer or monitor the installer log file. What you need to monitor for is specific to the installer package you are running.
I thought about doing this, but I don't think it will work for my problem. What I'm trying to do, is this:. I'm trying to add a Task toward the end of my Task Sequence that will run a local command, that prompts the Radia Software Manager client to call to the server and install any applications entitled to it. EXE" is running. EXE", preventing that script from closing, which will in turn let LiteTouch know the Task is still running, and not to continue to the next task.
And so far with McAfee I haven't been able to identify a common process that runs only when components are installing. I'm not asking for anyone to write this for me, just a nudge in the right direction would be very helpful.
You are out of luck. I bet they do. Sorry, but this forum is for answering specific scripting questions rather than writing script solutions. A big part of what you need to do is to write a rigorously specific technical problem definition. Only then will you be able to write code to solve the problem. Dwell time, meaning it will wait a defined number of seconds for the process after it has ended to make sure it doesn't start back up. If it reoccurs during that time period, it checks again after it's ended, and so on.
I'm assuming a loop function would be needed but I can't find a way to delay Wait-Process, know of a similar cmdlet that would work in this case. Looping Wait-Process and Start-Sleep with a retry count if result is equal to "can't find process" was my other idea.
Not ideal but would narrow the margin of error. I'm not asking for anyone to write a free script for me. If anyone knows of something like this being done and has a example they can point me to, great! If you know it's possible, but know it will require heavy scripting that your not about to provide for free kind of what I'm getting from your post , I get it.
I apologize, jrv. I completely misread your response. I didn't catch the part where you stated this has been tried times before and no solution was found. That does change things. As Bill has pointed out you have not defined your technical requirements. Without that it will be hardd to find or even guess at an answer. That worked perfectly!
GetFolder strFolder Open Fil x4WB. Run strMyMacro x4WB. Any ideas? Thanks, QF. Improve this question. Community Bot 1 1 1 silver badge. Add a comment. Active Oldest Votes. You need to tell the run to wait until the process is finished. CreateObject "WScript.
Improve this answer. Peter Mortensen Maybe I misunderstood the question but the File Loop is inside the vbs and hence the above method can't be used for making the script wait after x4WB. Close : But then like I said, I could have misunderstood it Where you have your "command" variable and you then pass that to your WScript object I have already done that in my HTA.
My myScript. Still, I have tried your idea within myScript. Shell" WshShell. In addition to my comment as I ran out of space, I have tested what string I am passing to Excel to test if it is a bad string by printing it in a MsgBox. However, the MsgBox shows that I am passing the string of the file to Excel correctly. I don't understand what else could be the issue. Try out the full command line in a console fist — peter. I'll try again Show 6 more comments.
0コメント