stephenmbell
IS-IT--Management
I am writing an application that will shell out to c:\windows\system32\shutdown.exe
This application will start by scheduled task - 15 minutes before I actually want the machine to reboot.
I have a timer on my form, with an interval of 90000 (which I believe is 15 minutes)
The event does fire, but it seems to fire in under a minute, not the 15 minutes that the interval property is set to.
Below is the code that I wrote, it is surrounded by the formload event and timer tick event that vs.net 2003 automatically did for me.
Any help would be greatly appreciated
sb
On FormLoad:
MyTimer.Tick Event:
This application will start by scheduled task - 15 minutes before I actually want the machine to reboot.
I have a timer on my form, with an interval of 90000 (which I believe is 15 minutes)
The event does fire, but it seems to fire in under a minute, not the 15 minutes that the interval property is set to.
Below is the code that I wrote, it is surrounded by the formload event and timer tick event that vs.net 2003 automatically did for me.
Any help would be greatly appreciated
sb
On FormLoad:
Code:
'enable & start the timer
myTimer.Enabled = True
myTimer.Start()
MyTimer.Tick Event:
Code:
Dim strMachine As String = Environment.MachineName
Dim strCommand As String
Dim ret As Integer
'set the command to reboot register
strCommand = "C:\windows\system32\shutdown.exe -m \\" & strMachine & " -f -t 15 -f"
ret = Shell(strCommand)