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.
This topic is 14 years and 5 days old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
msn_user
Posts: 1
Last visit: Mon Aug 10, 2009 11:31 am

Detecting Internet connection Speed using WMI?

Post by msn_user »

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?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Detecting Internet connection Speed using WMI?

Post by jvierra »

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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Detecting Internet connection Speed using WMI?

Post by jvierra »

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
Last visit: Sun Apr 11, 2010 5:28 pm

Detecting Internet connection Speed using WMI?

Post by daluu »

Does that work for modem/dialup connections?
This topic is 14 years and 5 days old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked