Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7971221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:35:08+00:00 2026-06-04T07:35:08+00:00

I am working on a project where I need to modify a script used

  • 0

I am working on a project where I need to modify a script used for network documentation. The current script that we use is a modified version of SYDI, found here. What I would like to do is add to this script the ability to execute a netstat -an and have it returned with the rest of the report. I was curious if anyone has used WMI and VBScript to return netstat information and how it might be able to be incorporated into this script.

NOTE: I am not trying to promote a product and I am not affiliated with the SYDI project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:35:09+00:00Added an answer on June 4, 2026 at 7:35 am

    You could run netstat and capture the result like the script here under, but much info is also available from activeX but the i would need to know what information you need exactly.

    set sh = CreateObject("Wscript.Shell") 
    set Connections = CreateObject("Scripting.Dictionary") 
    
    call Main() 
    
    Function Main() 
        call GetConnections() 
        call ProcessConnections() 
    End Function 
    
    Function GetConnections() 
        i = 0 
        set shExec = sh.Exec("netstat -f") 
    
        Do While Not shExec.StdOut.AtEndOfStream 
            Line = shExec.StdOut.ReadLine() 
            If Instr(Line, "TCP") <> 0 Then 
                Set Connection = New NetworkConnection 
                Connection.ParseText(Line) 
                call Connections.Add(i, Connection) 
                i = i + 1 
            End If 
        Loop 
    End Function 
    
    Function ProcessConnections() 
        For Each ConnectionID in Connections.Keys 
            wscript.echo ConnectionID & Connections(ConnectionID).RemoteIP 
        Next 
    End Function 
    
    Class NetworkConnection 
        Public Protocol 
        Public LocalIP 
        Public LocalPort 
        Public RemoteIP 
        Public RemotePort 
    
        Public Sub ParseText(Line) 
            dim i 
    
            For i = 5 to 2 Step -1 
                Line = Replace(Line, String(i, " "), " ") 
            Next 
    
            Line = Replace(Line, ":", " ") 
            Line = Right(Line, Len(Line) - 1) 
            Line = Split(Line, " ") 
    
            Protocol = Line(0) 
            LocalIP = Line(1) 
            LocalPort = Line(2) 
            RemoteIP = Line(3) 
            RemotePort = Line(4) 
    
        End Sub 
    
        Private Sub Class_Initialize 
            'MsgBox "Initialized NetworkConnection object" 
        End Sub 
    
    End Class
    

    EDIT: based on the comment of OP here a simplified version

    set sh = CreateObject("Wscript.Shell")  
    call GetConnections()  
    
    Function GetConnections()  
      i = 0  
      set shExec = sh.Exec("netstat -an")  
       Do While Not shExec.StdOut.AtEndOfStream  
          Wscript.Echo shExec.StdOut.ReadLine()  
      Loop  
    End Function  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project where I need to create a link that when
I'm working on a project that I need to eliminate all references to the
I am working in a iPhone project that uses restful web services. I need
i am working on project developed in Qt, Windows, i use Qt Version 4.1.4
I'm working on project that need do call the same method several times, but
I'm working on project that need to control sending queue by code. So I
i am working on a project that need to upload files from iphone to
Need to modify Log4PostSharp project by inheriting from the ready-made (and working) custom attribute.
I might need to use iTextSharp for a project I'm working on. I'd prefer
I am working with a Visual Studio project file, and I need to modify

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.