Here's a simple one (I hope)
The entire code follows between equal sign lines:
Set WshShell = WScript.CreateObject("WScript.Shell")
bWaitOnReturn = true
Return = WshShell.Run("""C:\Program Files\Novosoft\Handy Backup\hbagent.exe"" -e HB-DAVE-LOCAL-FULL-TEST1", 1, bWaitOnReturn)
wscript.echo "All done"
Have tried all the things I can think of to get the script to wait, to no avail. Script has always run the specified program ("hbagent.exe") but has never waited for it to finish. The "All done" eyecatcher always appears prior to the compleation of the program. I've tried using the values (all with and without the quotes) "true" "TRUE", "1", and as this example shows, a variable set to the value of "true". The hbagent has no GUI of its own but works in conjuction with a GUI, if it's open.
I've looked long and hard before asking this question and can't find any examples that I could try, and all seem to be exactly what I've tried, but without success.
Does the bWaitOnReturn value only work if there is a displayable window??