Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


help with script - html output

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,34969
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> help with script - html output
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 help with script - html output - 5/30/2006 7:30:04 AM   
  tjritch

 

Posts: 2
Score: 0
Joined: 11/4/2005
Status: offline
new to scripting...keep getting errors running this script:

'===================================================================
Dim oShell: Set oShell = CreateObject("Wscript.Shell")
forceUseCScript
Dim oIE: Set oIE = CreateObject("InternetExplorer.Application")
Dim ScriptPath: ScriptPath = Left(Wscript.ScriptFullName,Len(WScript.ScriptFullName) - Len(WScript.ScriptName))
Dim strComputers, reply, parse
Dim strComputer: strComputer = Split(replace(InputBox("ENTER PC NAMES COMMA DELIMITED","Enter the PC's to monitor IP connectivity","www.microsoft.com,localhost,www.google.com,127.0.0.1,anybogusname")," ",""),",")
ReDim strComputers(UBound(strComputer),1)
    
  For i = 0 To UBound(strComputer)
        strComputers(i,0) = strComputer(i)
        strComputers(i,1) = "UNK"
  Next
setupDisplay
num = 0
Do While IsObject(oIE)
   strHtml = "
chr(34) & "position: absolute; left: 1; top: 1" & Chr(34) & ">"
  For i = 0 To UBound(strComputers,1)
     oIE.Document.Title = "Now Checking " & strComputers(i,0) & "..."
     strComputers(i,1) = pingHost(strComputers(i,0), parse)
     strHtml = strHtml & "|"
        Select Case strComputers(i,1)
           Case "UNK"
              strHtml = strHtml & "Chr(34) & parse & Chr(34) & ">" & strComputers(i,0) & ""
           Case "UP"
              strHtml = strHtml & "Chr(34) & parse & Chr(34) & ">" & strComputers(i,0) & ""
           Case "DOWN"
              strHtml = strHtml & "Chr(34) & parse & Chr(34) & ">" & strComputers(i,0) & ""
           Case Else
              strHtml = strHtml & "Chr(34) & parse & Chr(34) & ">" & strComputers(i,0) & ""
        End Select
  Next
  strHtml = strHtml & "|
"
  oIE.Document.body.innerhtml = strHTML
  For i = 1 To 5
     oIE.Document.Title = "Waiting 5 seconds... " & i
     WScript.Sleep 1000
  next
Loop
function pingHost(host, parse)
  strCmd = "%COMSPEC% /C ping " & host & " -n 1"
  Set reply = oShell.Exec(strCmd)
  While Not reply.StdOut.atendofstream
     parse = reply.StdOut.readline
        If InStr(parse,"Reply") Then
           pingHost = "UP"
              reply.StdOut.readAll
                 Exit function
        Elseif InStr(parse,"timed out") Then
           pingHost = "DOWN"
              reply.StdOut.readAll
                 Exit function
        ElseIf InStr(parse,"Unknown") Then
           pingHost = "UNK"
              reply.StdOut.readAll
                 Exit function
        Else
           pingHost = "UNK"
        End If
  Wend
End function
Sub setupDisplay()
  oIE.AddressBar = False
  oIE.Height = 55
  oIE.Width = 75
  oIE.MenuBar = False
  oIE.Resizable = True
  oIE.StatusBar = False
  oIE.ToolBar = False
  oIE.Navigate "about:blank"
  oIE.FullScreen = true
     maxWidth = oIE.width
     maxHeight = oIE.Height
  oIE.FullScreen = False
  oIE.Top = maxHeight - 75
  oIE.width = maxWidth
  oIE.Visible = True
  oShell.AppActivate "about:blank"
  oIE.Document.Title = "Loading..."
  oIE.Document.body.innerhtml = "chr(34) & "position: absolute; left: 1; top: 1" & Chr(34) & ">Loading..."
  WScript.Sleep 2000
End Sub
Sub forceUseCScript()
  If Not WScript.FullName = WScript.Path & "\cscript.exe" Then
     oShell.Run WScript.Path & "\cscript.exe //NOLOGO " & Chr(34) & WScript.scriptFullName & Chr(34),1,False
     WScript.Sleep 2000
     WScript.Quit 0
  End If
End Sub
 
 
Post #: 1
 
 RE: help with script - html output - 5/30/2006 9:38:30 AM   
  BBistheKing

 

Posts: 107
Score: 0
Joined: 6/21/2005
Status: offline
Try this...


      

_____________________________

"Live simply, that others may simply live." - Mahatma Gandhi

(in reply to tjritch)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> help with script - html output Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts