Package com.jgcomptech.tools
Class OSInfo.Windows.WMI
- java.lang.Object
-
- com.jgcomptech.tools.OSInfo.Windows.WMI
-
- Enclosing class:
- OSInfo.Windows
public static final class OSInfo.Windows.WMI extends java.lang.Object
Returns information from WMI.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
executeDemoQueries()
static java.lang.String
getEnvironmentVar(java.lang.String variableName)
Get an environment variable from Windows.static java.lang.String
getWMIValue(java.lang.String wmiQueryStr, java.lang.String wmiCommaSeparatedFieldName)
Get the given WMI value from the WMI subsystem on the local computer.
-
-
-
Method Detail
-
getEnvironmentVar
public static java.lang.String getEnvironmentVar(java.lang.String variableName) throws java.io.IOException, java.lang.InterruptedException
Get an environment variable from Windows.- Parameters:
variableName
- The name of the environment variable to get- Returns:
- The value of the environment variable
- Throws:
java.io.IOException
- if error occursjava.lang.InterruptedException
- if command is interruptedjava.lang.IllegalArgumentException
- if Environment Variable does't exist
-
getWMIValue
public static java.lang.String getWMIValue(java.lang.String wmiQueryStr, java.lang.String wmiCommaSeparatedFieldName) throws java.io.IOException, java.lang.InterruptedException
Get the given WMI value from the WMI subsystem on the local computer.- Parameters:
wmiQueryStr
- the query string as syntactically defined by the WMI referencewmiCommaSeparatedFieldName
- the field object that you want to get out of the query results- Returns:
- the value
- Throws:
java.io.IOException
- if error occursjava.lang.InterruptedException
- if command is interrupted
-
executeDemoQueries
public static void executeDemoQueries() throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
-