[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Finding network computer status more quickly

Posted on 2008-06-25
1
Medium Priority
?
250 Views
Last Modified: 2010-05-18
I am running a code that is querying a folder on all of my remote computers in order to see if the computer is turned on or off.

Now the code works perfectly, but when there is a computer turned off the timeout is very long.  I am wondering if there's a way I can speed up the process for failed computers.

Thanks
Dim LastRow As String
    Dim i As Integer
    Dim Computer As String
    Dim fso As New FileSystemObject
    Dim d
    
    LastRow = Range("A65536").End(xlUp).Row
 
    On Error Resume Next
    
    For i = 1 To LastRow
 
            Computer = Range("A" & i & "").Value
 
            fso.GetFolder ("\\" & Computer & "\c$")
            
            If Err.Number <> 0 Then
                Err.Clear
                Cells(i, 2) = "Fail"
            Else
                Cells(i, 2) = "Good"
            End If
 
    Next i

Open in new window

0
Comment
Question by:ScotTFO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
ScotTFO earned 0 total points
ID: 21898649
I have resolved this issue myself using:
Function SystemOnline(ByVal ComputerName As String)
    Dim colPingResults As Variant
    Dim oPingResult As Variant
    Dim strQuery As String
 
    strQuery = "SELECT * FROM Win32_PingStatus WHERE Address = '" & ComputerName & "'"
 
    Set colPingResults = GetObject("winmgmts://./root/cimv2").ExecQuery(strQuery)
    For Each oPingResult In colPingResults
        If Not IsObject(oPingResult) Then
            SystemOnline = False
        ElseIf oPingResult.StatusCode = 0 Then
            SystemOnline = True
        Else
            SystemOnline = False
        End If
    Next
End Function

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question