I've got the following as part of an If...Then construct at the end of a normal vbs file:
.....
Set sa=CreateObject("Shell.Application"
sa.ShutdownWindows
Else
Wscript.Quit
End If
As you can see if we pass through ShutdownWindows we will fall through to the end of the script and we are presented with the ShutdownWindows dialog.
The application is fine and I can live it as it stands but I wanted to extend the code so that if the Cancel option was chosen then I would follow on with something else. Unfortunately, sa.ShutdownWindows has no return value and if I follow with a MsgBox the ShutdownWindows dialog unceremoniously vanishes before I get a chance to opt for anything. I've tried a long sleep before the MsgBox but that doesn't sit right with me.
Any ideas?
Regards,
David
.....
Set sa=CreateObject("Shell.Application"
sa.ShutdownWindows
Else
Wscript.Quit
End If
As you can see if we pass through ShutdownWindows we will fall through to the end of the script and we are presented with the ShutdownWindows dialog.
The application is fine and I can live it as it stands but I wanted to extend the code so that if the Cancel option was chosen then I would follow on with something else. Unfortunately, sa.ShutdownWindows has no return value and if I follow with a MsgBox the ShutdownWindows dialog unceremoniously vanishes before I get a chance to opt for anything. I've tried a long sleep before the MsgBox but that doesn't sit right with me.
Any ideas?
Regards,
David