+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
Scripts Thread, script to detect network speed in Coding and Web Development; brilliant!! Thats works with the computer name. this is the current output. Computer Name: ICT -03 InstanceName: Broadcom NetXtreme 57xx ...
  1. #16
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    brilliant!!

    Thats works with the computer name.
    this is the current output.

    Computer Name: ICT-03
    InstanceName: Broadcom NetXtreme 57xx Gigabit Controller
    NdisLinkSpeed: 1000 mbps
    InstanceName: WAN Miniport (IP)
    NdisLinkSpeed: 0.0288 mbps
    InstanceName: WAN Miniport (IP) - Packet Scheduler Miniport
    NdisLinkSpeed: 0.0288 mbps
    InstanceName: Broadcom NetXtreme 57xx Gigabit Controller - Packet Scheduler Miniport
    NdisLinkSpeed: 1000 mbps
    How do I get rid of all the other unneccesary network connections. All i want to know is the main one.

  2. #17

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    I believe this should do it, tried to comment code a bit too :P Minds playing games on me, but think I worked out mbps/mbps right.

    Anyone below 1mb should get cut off, aka only "main" connections


    'Define Variables for script
    Dim NetName, NetSpeed, CompName, myFSO, WriteNetName

    'Default Blank the variables
    NetName = ""
    NetSpeed = ""
    CompName = ""

    'Set File Links
    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteNetName = myFSO.OpenTextFile("yourtextfile.txt", 8, True)

    'Sets Computer Name/IP
    strComputer = "."

    'Links into Win32 system for information
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

    'Scans data for Computer Name Information
    For Each objItem in colItems
    CompName = "Computer Name: " & objItem.Name
    WriteNetName.WriteLine(CompName)
    Next

    'Links into MSNDis_Linkspeed for information
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")

    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)

    'Scans data for Net Speed and Name
    For Each objItem in colItems

    'Removes "slow/unused links"
    if objItem.NdisLinkSpeed/10 > 1000 then

    NetName = "InstanceName: " & objItem.InstanceName

    If objItem.NdisLinkSpeed/10 > 10000 Then
    NetSpeed = "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10000 & " Mbps"
    Elseif objItem.NdisLinkSpeed/10 > 1000 then
    NetSpeed = "NdisLinkSpeed: " & objItem.NdisLinkSpeed/10 & " kbps"
    End If




    'Writes data to file
    WriteNetName.WriteLine(NetName)
    WriteNetName.WriteLine(NetSpeed)

    else
    'Fall out clause for "non-used" connections
    end if


    Next

    'closes Links and Resets items
    WriteNetName.Close
    SET WriteNetName = NOTHING
    SET myFSO = NOTHING
    See how it goes!

  3. #18

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    aka:

    Gives me

    Computer Name: ICTTECH-01
    InstanceName: Intel(R) 82567LM-3 Gigabit Network Connection
    NdisLinkSpeed: 1000 Mbps
    instead of:

    InstanceName: Intel(R) 82567LM-3 Gigabit Network Connection
    NdisLinkSpeed: 1000000 kbps
    InstanceName: WAN Miniport (Network Monitor)
    NdisLinkSpeed: 115.2 kbps
    InstanceName: WAN Miniport (IP)
    NdisLinkSpeed: 115.2 kbps
    InstanceName: WAN Miniport (IPv6)
    NdisLinkSpeed: 115.2 kbps
    InstanceName: RAS Async Adapter
    NdisLinkSpeed: 28.8 kbps

  4. #19


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,591
    Thank Post
    228
    Thanked 856 Times in 735 Posts
    Rep Power
    296
    just thinking out loud here would it be better/possible to ditch the "InstanceName: " etc and the caridge returns and just output for example

    pc1,VIA Rhine II Fast Ethernet Adapter,100 Mbps,VIA Rhine II Fast Ethernet Adapter - Packet Scheduler Miniport,100 Mbps [enter]

    that way its an instant csv file so can be quickly thrown into excel

  5. #20

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by sted View Post
    just thinking out loud here would it be better/possible to ditch the "InstanceName: " etc and the caridge returns and just output for example

    pc1,VIA Rhine II Fast Ethernet Adapter,100 Mbps,VIA Rhine II Fast Ethernet Adapter - Packet Scheduler Miniport,100 Mbps [enter]

    that way its an instant csv file so can be quickly thrown into excel
    Well it's possible :P Not sure what Admiral prefers though, So either way can be done :P or you want it done to steal it?!?! lol

    Steve

  6. #21

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by sted View Post
    just thinking out loud here would it be better/possible to ditch the "InstanceName: " etc and the caridge returns and just output for example

    pc1,VIA Rhine II Fast Ethernet Adapter,100 Mbps,VIA Rhine II Fast Ethernet Adapter - Packet Scheduler Miniport,100 Mbps [enter]

    that way its an instant csv file so can be quickly thrown into excel

    Just for you :P (Only a few lines change anyway)

    Example:
    ICTTECH-01,Intel(R) 82567LM-3 Gigabit Network Connection,1000 Mbps
    Code:
    'Define Variables for script
    Dim NetName, NetSpeed, CompName, myFSO, WriteNetName

    'Default Blank the variables
    NetName = ""
    NetSpeed = ""
    CompName = ""

    'Set File Links
    Set myFSO = CreateObject("Scripting.FileSystemObject")
    Set WriteNetName = myFSO.OpenTextFile("yourtextfile.txt", 8, True)

    'Sets Computer Name/IP
    strComputer = "."

    'Links into Win32 system for information
    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")

    'Scans data for Computer Name Information
    For Each objItem in colItems
    CompName = objItem.Name
    Next

    'Links into MSNDis_Linkspeed for information
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\WMI")

    Set colItems = objWMIService.ExecQuery("SELECT * FROM MSNdis_LinkSpeed",,48)

    'Scans data for Net Speed and Name
    For Each objItem in colItems

    'Removes "slow/unused links"
    if objItem.NdisLinkSpeed/10 > 1000 then

    NetName = objItem.InstanceName

    If objItem.NdisLinkSpeed/10 > 10000 Then
    NetSpeed = objItem.NdisLinkSpeed/10000 & " Mbps"
    Elseif objItem.NdisLinkSpeed/10 > 1000 then
    NetSpeed = objItem.NdisLinkSpeed/10 & " kbps"
    End If

    'Writes data to file
    WriteNetName.WriteLine(CompName & "," & NetName & "," & NetSpeed)

    else
    'Fall out clause for "non-used" connections
    end if

    Next

    'closes Links and Resets items
    WriteNetName.Close
    SET WriteNetName = NOTHING
    SET myFSO = NOTHING


    *Edit - Files attached

    NetworkSpeed.vbs
    NetworkSpeedCSV.vbs
    Last edited by Steve21; 16th March 2011 at 01:20 PM. Reason: Adding Files

  7. 2 Thanks to Steve21:

    Admiral208 (16th March 2011), sted (16th March 2011)

  8. #22
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    Steve, you are a vbs god!!!

    one last thing...

    can we get the results separated with a line i.e.

    results 1
    ================
    results 2
    ================

    I owe you one!! virtual edubeer in the post!!

  9. #23

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by Admiral208 View Post
    Steve, you are a vbs god!!!

    one last thing...

    can we get the results separated with a line i.e.

    results 1
    ================
    results 2
    ================

    I owe you one!! virtual edubeer in the post!!
    Which version? Original or CSV style as Sted said about?

    And which bits seperate? :P Per computer? or like per line?

    Post example please!

    Steve

  10. #24
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    original per computer. ie.

    ====================================
    Computer Name: ICTTECH-01
    InstanceName: Intel(R) 82567LM-3 Gigabit Network Connection
    NdisLinkSpeed: 1000 Mbps
    ====================================
    Computer Name: ICTTECH-02
    InstanceName: Intel(R) 82567LM-3 Gigabit Network Connection
    NdisLinkSpeed: 1000 Mbps
    ====================================
    Computer Name: ICTTECH-03
    InstanceName: Intel(R) 82567LM-3 Gigabit Network Connection
    NdisLinkSpeed: 1000 Mbps

  11. #25

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    How's this:

    NetworkSpeedAdmiral.vbs

    Steve

  12. Thanks to Steve21 from:

    Admiral208 (16th March 2011)

  13. #26


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,591
    Thank Post
    228
    Thanked 856 Times in 735 Posts
    Rep Power
    296
    Quote Originally Posted by Steve21 View Post
    Well it's possible :P Not sure what Admiral prefers though, So either way can be done :P or you want it done to steal it?!?! lol

    Steve
    thanks im not great with vbs (i still default to batch files for most things i just find it easier for a lot of what i need to do) and just couldnt see how to alter it but yes basically i want to steal it and have it running as a startup script lol

  14. #27

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by sted View Post
    thanks im not great with vbs (i still default to batch files for most things i just find it easier for a lot of what i need to do) and just couldnt see how to alter it but yes basically i want to steal it and have it running as a startup script lol
    Your version is attached few posts up :P #21 the CSV one.

    Yeah batch files are nice, I prefer them, but with GPOs locking it all down, seems vbs is getting more used :P

    Oh well :P Hope those files help you both. (Just remember to set a path for the Text file)

    Anything else, just shout or throw a PM

    Steve

  15. #28


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,591
    Thank Post
    228
    Thanked 856 Times in 735 Posts
    Rep Power
    296
    Quote Originally Posted by Steve21 View Post
    Your version is attached few posts up :P #21 the CSV one.

    Yeah batch files are nice, I prefer them, but with GPOs locking it all down, seems vbs is getting more used :P

    Oh well :P Hope those files help you both. (Just remember to set a path for the Text file)

    Anything else, just shout or throw a PM

    Steve
    im tempted to just give up on vbs (i can usually alter other people to fit lol) and just go straight to powershell it seems more doslike to me in command structure etc

    just fiddling with it nowseeing what happens if multiple pcs write to the file etc though i think ive found the slowest pcs ever lol

  16. #29
    Admiral208's Avatar
    Join Date
    Mar 2008
    Location
    Bridgwater
    Posts
    720
    Thank Post
    176
    Thanked 63 Times in 55 Posts
    Rep Power
    40
    Thanks Steve. Thats absolutly perfect!!

    On a completely unrelated matter,

    here are the results from when I run the vbs

    Computer Name: ICT-03
    InstanceName: Broadcom NetXtreme 57xx Gigabit Controller
    NdisLinkSpeed: 1000 Mbps
    InstanceName: Broadcom NetXtreme 57xx Gigabit Controller - Packet Scheduler Miniport
    NdisLinkSpeed: 1000 Mbps
    What is the packet scheduler miniport all about??

  17. #30

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,696
    Thank Post
    335
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by Admiral208 View Post
    Thanks Steve. Thats absolutly perfect!!

    On a completely unrelated matter,

    here are the results from when I run the vbs



    What is the packet scheduler miniport all about??
    I take it you're running XP?

    It's part of the QoS service available "normally in XP", that allows alternative connections aka PPPoE etc. You probably have a QoS service enabled somewhere, but really it's no harm being on. Just classes it as a second connection.

    Could try to remove them from results when I'm at work tomorrow if it bothers you?

    Steve

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Old Server - help speed up network?
    By titch in forum Hardware
    Replies: 7
    Last Post: 19th January 2011, 11:00 AM
  2. Testing network speed
    By Ayaz in forum Windows
    Replies: 10
    Last Post: 19th November 2010, 09:24 AM
  3. Problems with Network Speed
    By Muddyfox in forum Network and Classroom Management
    Replies: 4
    Last Post: 29th April 2010, 10:41 AM
  4. Network Crawl, then sudden speed up...
    By markwilliamson2001 in forum Wireless Networks
    Replies: 2
    Last Post: 7th October 2008, 04:33 PM
  5. How to speed up a network without any uprades.
    By FN-GM in forum Wireless Networks
    Replies: 14
    Last Post: 30th January 2008, 08:11 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •