Forum

[VBScript] Auto rec...
 
Notifications
Clear all

[VBScript] Auto reconnect

0 Posts
1 Users
0 Reactions
83 Views
(@joshua0139)
New Member
Joined: 11 years ago
Posts: 1
Topic starter  

caked a few snippits together to get this working, enjoy
cpu friendly

Sub Main

Dim con
Dim status
status=Terminal.SendText("")
Do Until i=10
subSleep(10)
If status = True Then
Else
con=Terminal.Connect(5)
End If
Loop
End Sub

Sub subSleep(strSeconds) ' subSleep(2)
    Dim objShell
    Dim strCmd
    set objShell = CreateObject("wscript.Shell")
    'objShell.Run cmdline,1,False

    strCmd = "%COMSPEC% /c ping -n " & strSeconds & " 127.0.0.1>nul"     
    objShell.Run strCmd,0,1 
End Sub 

   
ReplyQuote
Share: