FAQ FAQ  Forum Search   Register Register  Login Login

Detecting Internet connection Speed using WMI?

 Post Reply Post Reply
Author
  Topic Search Topic Search  Topic Options Topic Options
msn_user View Drop Down
I'm new here
I'm new here


Joined: 10 Aug 2009
Online Status: Offline
Posts: 3
  Quote msn_user Quote  Post ReplyReply bullet Topic: Detecting Internet connection Speed using WMI?
    Posted: 10 Aug 2009 at 18:31
Hi
 
I wanted to know what is the best way to know the internet connection type/Speed of the user?
I tried couple of things like using following code
 
strServer = "."

Set objWMI = GetObject("winmgmts://" & strServer & "/root\WMI")
Set objInstances = objWMI.InstancesOf("MSNdis_LinkSpeed",48)

On Error Resume Next
For Each objInstance in objInstances
    With objInstance
        WScript.Echo .Active
        WScript.Echo .InstanceName
        WScript.Echo .NdisLinkSpeed
    End With
On Error Goto 0
Next
 
I get RPC Server not available?

 
Back to Top
jvierra View Drop Down
MVP
MVP


Joined: 31 Aug 2006
Location: United States
Online Status: Offline
Posts: 6846
  Quote jvierra Quote  Post ReplyReply bullet Posted: 10 Aug 2009 at 21:44
It looks like you have issues with WMI on your PC.
 
Go to Microsoft Downloads and download WMIDiag and follow the instuctions in the included documents.
 
 
Back to Top
msn_user View Drop Down
I'm new here
I'm new here


Joined: 10 Aug 2009
Online Status: Offline
Posts: 3
  Quote msn_user Quote  Post ReplyReply bullet Posted: 11 Aug 2009 at 15:00
I get invalid name space when i use the following js code:
 

var locator = new ActiveXObject("WbemScripting.SWbemLocator");

var service = locator.ConnectServer("\root\WMI");

var properties = service.ExecQuery("SELECT * FROM MSNdis_LinkSpeed");

var e = new Enumerator(properties);

var p;

for (; !e.atEnd(); e.moveNext()) {

p = e.item();

}

processorInfo = p.NdisLinkSpeed;

any reasons? I am trying to find the connection speed in XP machine? if there is any better way to detect can any of you share the logic?

 
Thanks in Advance..
MSN
Back to Top
jvierra View Drop Down
MVP
MVP


Joined: 31 Aug 2006
Location: United States
Online Status: Offline
Posts: 6846
  Quote jvierra Quote  Post ReplyReply bullet Posted: 11 Aug 2009 at 15:17
Opps:
 
You changed languages.  You started with vbscript and switched to JScript.
 
Here:

var locator = new ActiveXObject("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".","root/WMI");
var properties = service.ExecQuery("SELECT * FROM MSNdis_LinkSpeed");
var e = new Enumerator(properties);
for (; !e.atEnd(); e.moveNext()) {
    var p = e.item();
    WScript.Echo(p.NdisLinkSpeed)
}



Edited by jvierra - 11 Aug 2009 at 15:27
Back to Top
msn_user View Drop Down
I'm new here
I'm new here


Joined: 10 Aug 2009
Online Status: Offline
Posts: 3
  Quote msn_user Quote  Post ReplyReply bullet Posted: 13 Aug 2009 at 18:00
It worked fine..Thanks for quick reply.
Back to Top
nivetha View Drop Down
I'm new here
I'm new here


Joined: 07 Oct 2009
Online Status: Offline
Posts: 1
  Quote nivetha Quote  Post ReplyReply bullet Posted: 07 Oct 2009 at 20:49
You can find the internet speed through the site http://www.ip-details.com/
Back to Top
jvierra View Drop Down
MVP
MVP


Joined: 31 Aug 2006
Location: United States
Online Status: Offline
Posts: 6846
  Quote jvierra Quote  Post ReplyReply bullet Posted: 07 Oct 2009 at 21:42
nivetha - that is not the question that was asked.  It is not a scripted answer. 
 
I don't yhink you intended this but Ihat website is also known as a source of malware.  It tries to install an ActiveX control that may be used for inserting trojans.
 
It does NOT give you the connection speed of a network card.
 
 
 


Edited by jvierra - 07 Oct 2009 at 21:44
Back to Top
daluu View Drop Down
I'm new here
I'm new here


Joined: 11 Apr 2010
Online Status: Offline
Posts: 6
  Quote daluu Quote  Post ReplyReply bullet Posted: 12 Apr 2010 at 00:28
Does that work for modem/dialup connections?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down