I have done my best but can seem to get my loop to stop. I am trying to make it run every 5 minutes on the hour. Any help would be great
strComputer = "."
Set objNetwork = CreateObject("Wscript.Network")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
Dim objNet
On Error Resume Next
Set objNet = CreateObject("WScript.NetWork")
Dim strInfo
strInfo = objNet.UserName
strComputer = objNetwork.ComputerName
myLogOn = DateAdd ("n", 0, Time())
myEndTime = DateAdd ("n", 1, Time())
Do
If myLogOn > myEndTime Then
Wscript.Echo myLogOn & " is after " & myEndTime
'Exit Do
ElseIf myLogOn < myEndTime Then
'If last = Minute(current) Then
MsgBox "Please respond to the following message! Press OK"
MsgBox "This is a message from Information Services. We have recognized that this PC " & strComputer & " has not been migrated to the domain." & vbNewLine & "Please call Mathew in Information Services by dialing. " & vbNewLine & "Or please leave Voice Message with the following information: " & vbNewLine & strInfo & vbNewLine & strComputer & vbNewLine &"myLogOn Location of your PC " & vbNewLine & "Contact Number"
End If
Loop While myLogOn < myEndTime