Hello All.
I am running InduSoft 8 sp4.
Trying to do the following:
Sub Screen_WhileOpen()
If $PCshutdown = True Then
$EndTask ("viewer")
$Wait (10000)
$Exec ("shutdown.exe /s /t 00 ")
End If
End Sub
Basically i'm trying to shutdown the windows PC. The reason I'm trying to use a wait command is because if I run the script without it, windows will prompt that it can't shutdown because CEVIIEWER is still open. I thought that if I put a pause in between closing the viewer and running the windows shutdown command that enough time would have passed for the viewer to completely close before windows begins the shutdown process.
Doesn't seem to work. Windows request to either "Cancel" or "Restart Anyway" prompts.
Any thoughts or recommendations are greatly appreciated.
Thanks