Sasstraliss
Programmer
My problem is a simple one.
When I open the .vbe file, a windows pops up with an Ok and Cancel button as well as a text box.
The function of the program is to shutdown local network computers, and this is done through shutdown.exe after you type in the computer's name and then hit enter.
However, my problem is this:
When you hit "Cancel" on the dialog box, the window comes back. Hitting "X" also does nothing.
I would like to make those ways of exiting actually exit the dialog box, and if possible, make it so that typing "e" and pressing enter also ends the program.
Any help on this simple problem would be greatly appreciated.
When I open the .vbe file, a windows pops up with an Ok and Cancel button as well as a text box.
The function of the program is to shutdown local network computers, and this is done through shutdown.exe after you type in the computer's name and then hit enter.
However, my problem is this:
When you hit "Cancel" on the dialog box, the window comes back. Hitting "X" also does nothing.
I would like to make those ways of exiting actually exit the dialog box, and if possible, make it so that typing "e" and pressing enter also ends the program.
Code:
Dim objShell, strComputer, strInput
Dim strShutdown
Do
strComputer = (InputBox(" ", ""))
If strComputer <> "" Then
strInput = True
exit do
End If
Loop until strInput = True
strShutdown = "shutdown -s -t 0 -f -m \\" & strComputer
set objShell = CreateObject("WScript.Shell")
objShell.Run strShutdown
Wscript.Quit
Any help on this simple problem would be greatly appreciated.