When a user fails to access the web service, it must be excellent to obtain the user's system configuration information. Our usual practice is to run some programs on the user's machine to obtain the user's system information. For general web pages, according to the http information, we can only obtain the customer's browser and simple system.
When a user fails to access the web service, it must be excellent to obtain the user's system configuration information.
Our usual practice is to run some programs on the user's machine to obtain the user's system information, while the general web page, according to the http information, generally, only the client's browser and simple system information can be obtained, and detailed physical information of the system is not obtained.
Now we try to use WMI to obtain system information.
Here is an introduction to Baidu Encyclopedia:
WMI is the core of the Windows 2 K/XP management system. WMI is a useful plug-in for other Win32 operating systems. WMI is based on CIMOM. CIMOM is the Common Information Model Object Manager. It is an Object database that describes the components of an operating system, provides a public interface for MMC and script programs to access the operating system components.
Let's look at the Code:
Function GetInformation () {var locator = new ActiveXObject ("WbemScripting. SWbemLocator "); var service = locator. connectServer (". "); var properties = service. execQuery ("select * from Win32_Processor"); // CPU information var value = ""; var e = new Enumerator (properties); (;! E. atEnd (); e. moveNext () {var p = e. item (); value + = p. Name;} return value ;}
Successful results:
Some problems encountered during this period:
An error message "invalid class" or "out of memory" was encountered during this period.
See here
Http://technet.microsoft.com/zh-cn/library/ff406382.aspx#E4H
The error message of x8001000010 indicates that you have attempted to reference a nonexistent WMI class. The cause of this error is generally the spelling of the class name. For example, you try to connect a class named Win32_Services (with a s at the end of it), and the actual class name is Win32_Service (with no s at the end ). The specified namespace is referenced. The script writer often connects to the root \ cimv2 namespace and tries to access the StdRegProv class. Unfortunately, StdRegProv is actually in the root \ default namespace. The class is not supported by the specified operating system. For example, the SystemRestore class (in the root \ default namespace) is only supported on Windows XP. If you try to access this class on (for example) a computer running Windows 2000, you will probably receive an "invalid class" error. Note: When you try to connect to a nonexistent class, the error you receive may not be 0x80041010, but 0x80041002 ("the object cannot be found ") or error 0x80041006 ("insufficient memory ").
Download http://technet.microsoft.com/en-US/scriptcenter/dd939957.aspx use discovery system no WMIClass
Download http://www.piaodown.com/soft/58986.htm tested by WMI Explorer, only a small amount of WMI information can be found
I am a Windows 7 7 system. refer to the following content to reset WMI
Only Windows Server 2003 Service Pack 1 and Windows XP Service Pack 2 contain built-in commands used to regenerate the WMI Repository. In other versions of Windows, you can perform the following steps to regenerate the Repository: 1. Stop the WMI Service. (Type net stop winmgmt in the command prompt .) 2. Rename the folder % windir % \ System32 \ Wbem \ Repository. (For example, % windir % \ System32 \ Wbem \ Repository_bad .) 3. After the folder is renamed, the WMI Repository cannot be found in the operating system. Therefore, the next time the operating system needs to access WMI information, it will automatically regenerate the repository. Restart the WMI Service (net start winmgmt) and then try to run your script again.
Solve the problem.
For more information, see msdn:
Http://msdn.microsoft.com/en-us/library/windows/desktop/aa394373 (v = vs.85). aspx
Extended: The system information cannot be correctly obtained until WMI is reset. The investigation found that flash can also obtain similar results, which may solve the problem of linux and mac detection. For details, refer:
Http://www.moock.org/asdg/technotes/echoVersion/