Detecting Internet connection Speed using WMI?

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
msn_user
Posts: 1
Joined: Mon Aug 10, 2009 11:28 am

Detecting Internet connection Speed using WMI?

Post by msn_user » Mon Aug 10, 2009 11:31 am

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 & "/rootWMI")Set objInstances = objWMI.InstancesOf("MSNdis_LinkSpeed",48)On Error Resume NextFor Each objInstance in objInstances With objInstance WScript.Echo .Active WScript.Echo .InstanceName WScript.Echo .NdisLinkSpeed End WithOn Error Goto 0Next

I get RPC Server not available?

User avatar
jvierra
Posts: 13395
Joined: Tue May 22, 2007 9:57 am
Contact:

Detecting Internet connection Speed using WMI?

Post by jvierra » Tue Aug 11, 2009 8:17 am

Opps:

You changed languages. You started with vbscript and switched to JScript.

Here:

Code: Select all

	
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)
}
jvierra2009-08-11 15:27:37

User avatar
jvierra
Posts: 13395
Joined: Tue May 22, 2007 9:57 am
Contact:

Detecting Internet connection Speed using WMI?

Post by jvierra » Wed Oct 07, 2009 2:42 pm

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.


jvierra2009-10-07 21:44:49

User avatar
daluu
Posts: 1
Joined: Sun Apr 11, 2010 6:58 am

Detecting Internet connection Speed using WMI?

Post by daluu » Sun Apr 11, 2010 5:28 pm

Does that work for modem/dialup connections?

Locked