View Full Version : WMI JavaScript
dsheller
10-27-2005, 02:01 AM
Am I able to use WMI with JavaScript, if so how. I have tried adapting the Scriptomatic stuff but can't get it to work. Basically I want to be able to gather information about the PC no matter what the browser being used is, I need information such as RAM, Processor(s), Video Card, Mobo, Bios, HardDrive(s), CdRom(s), Mac Address... etcetera.
If there is an easier way to do this that would be great! Also if there are any other easier ways to do this I would like to know!
liorean
10-27-2005, 02:26 AM
JavaScript in the browser is sandboxed - you can't get the information you want. Might be possible from a HTA though.
dsheller
10-27-2005, 02:38 AM
What is an "HTA", and is it cross platform? If you have any information that is great!
An HTA is an HTML application. more info here:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
dsheller
10-27-2005, 06:01 AM
Alright, great. I got the HTA to do it. Is there a way I can get the HTA to run automatically when a user say... clicks a button or the page loads? Also, will there be security issues with IE stopping it from running automatically without it prompting, and if so will I be able to do something to allow the user to prompt or make the browser recognize it as safe?
_Aerospace_Eng_
10-27-2005, 06:23 AM
No. How about you tell us what it REALLY is that you are trying to do. You seem to be wanting a lot of information from the user without them even knowing you got it. The question is why?
dsheller
10-27-2005, 07:44 AM
I understand it does seem rather malicious, however, that is not my intent. The user will be asked before to submit information.
Here is what I'm trying to do:
User goes to website ->
Enters Name, or whatever else ( haven't worked that out ) ->
HTA Runs and gets stats that i mentioned in the first post ->
HTA pushes them to a perl script sitting server side ->
Perl script puts them in to a database ->
Basically its an inventory system for my father.
_Aerospace_Eng_
10-27-2005, 07:52 AM
You can't run the HTA from the browser window. It needs to be ran locally.
dsheller
10-27-2005, 08:05 AM
Hmm... well is there another way I can get that information without having to have the user run anything by themselves? If not then I suppose this is the best way.
liorean
10-27-2005, 11:57 AM
Browsers sandbox JavaScript for a reason: To protect the user from privacy intrusions, and as a security measure against any type of attacks.
Java applets run in browsers are sandboxed too, for the same reasons. Heck, even ActiveX is pretty strongly sandboxed.
The information you want to get about a client machine can be collected by a local application that the user runs, but the browser environment is made to make this kind of information gathering as close to impossible as possible.
dsheller
10-27-2005, 11:05 PM
Well when I first tried this I started with ActiveX, which could access what I want. The only problem I have with ActiveX was that it always gave people security errors in IE so they couldn't use it unless they set their security settings down =/ I even got it digitally signed and marked it safe for scripting, but the problem still occurred. I wish I could get that to work, that seemed like the best method to me.
dugindog
10-27-2005, 11:25 PM
have a requirement of java, and create the calls using WMI inside a small java applet. this should work just fine.
good luck.
dsheller
10-28-2005, 01:17 AM
Are you able to call WMI without the use of Jawin? The only examples I can see utilize that.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.