TargetOperatingSystem - property in ROOT\CIMV2 namespace

TargetOperatingSystem in other namespaces

List of classes with TargetOperatingSystem local property in ROOT\CIMV2 namespace

propertyClassOrigin
TargetOperatingSystemCIM_ActionCIM_Action
TargetOperatingSystemCIM_CheckCIM_Check
TargetOperatingSystemCIM_SoftwareElementCIM_SoftwareElement

List of classes with TargetOperatingSystem derived property in ROOT\CIMV2 namespace

propertyClassOrigin
TargetOperatingSystemCIM_BIOSElementCIM_SoftwareElement
TargetOperatingSystemCIM_CopyFileActionCIM_Action
TargetOperatingSystemCIM_CreateDirectoryActionCIM_Action
TargetOperatingSystemCIM_DirectoryActionCIM_Action
TargetOperatingSystemCIM_DirectorySpecificationCIM_Check
TargetOperatingSystemCIM_DiskSpaceCheckCIM_Check
TargetOperatingSystemCIM_ExecuteProgramCIM_Action
TargetOperatingSystemCIM_FileActionCIM_Action
TargetOperatingSystemCIM_FileSpecificationCIM_Check
TargetOperatingSystemCIM_MemoryCheckCIM_Check
TargetOperatingSystemCIM_ModifySettingActionCIM_Action
TargetOperatingSystemCIM_OSVersionCheckCIM_Check
TargetOperatingSystemCIM_RebootActionCIM_Action
TargetOperatingSystemCIM_RemoveDirectoryActionCIM_Action
TargetOperatingSystemCIM_RemoveFileActionCIM_Action
TargetOperatingSystemCIM_SettingCheckCIM_Check
TargetOperatingSystemCIM_SoftwareElementVersionCheckCIM_Check
TargetOperatingSystemCIM_SwapSpaceCheckCIM_Check
TargetOperatingSystemCIM_VersionCompatibilityCheckCIM_Check
TargetOperatingSystemCIM_VideoBIOSElementCIM_SoftwareElement
TargetOperatingSystemWin32_BindImageActionCIM_Action
TargetOperatingSystemWin32_BIOSCIM_SoftwareElement
TargetOperatingSystemWin32_ClassInfoActionCIM_Action
TargetOperatingSystemWin32_ConditionCIM_Check
TargetOperatingSystemWin32_CreateFolderActionCIM_Action
TargetOperatingSystemWin32_DirectorySpecificationCIM_Check
TargetOperatingSystemWin32_DuplicateFileActionCIM_Action
TargetOperatingSystemWin32_EnvironmentSpecificationCIM_Check
TargetOperatingSystemWin32_ExtensionInfoActionCIM_Action
TargetOperatingSystemWin32_FileSpecificationCIM_Check
TargetOperatingSystemWin32_FontInfoActionCIM_Action
TargetOperatingSystemWin32_IniFileSpecificationCIM_Check
TargetOperatingSystemWin32_LaunchConditionCIM_Check
TargetOperatingSystemWin32_MIMEInfoActionCIM_Action
TargetOperatingSystemWin32_MoveFileActionCIM_Action
TargetOperatingSystemWin32_ODBCDataSourceSpecificationCIM_Check
TargetOperatingSystemWin32_ODBCDriverSpecificationCIM_Check
TargetOperatingSystemWin32_ODBCTranslatorSpecificationCIM_Check
TargetOperatingSystemWin32_ProgIDSpecificationCIM_Check
TargetOperatingSystemWin32_PublishComponentActionCIM_Action
TargetOperatingSystemWin32_RegistryActionCIM_Action
TargetOperatingSystemWin32_RemoveFileActionCIM_Action
TargetOperatingSystemWin32_RemoveIniActionCIM_Action
TargetOperatingSystemWin32_ReserveCostCIM_Check
TargetOperatingSystemWin32_SelfRegModuleActionCIM_Action
TargetOperatingSystemWin32_ServiceSpecificationCIM_Check
TargetOperatingSystemWin32_ShortcutActionCIM_Action
TargetOperatingSystemWin32_SoftwareElementCIM_SoftwareElement
TargetOperatingSystemWin32_SoftwareElementConditionCIM_Check
TargetOperatingSystemWin32_TypeLibraryActionCIM_Action

Code samples for TargetOperatingSystem property

Get instance of WMI class using GetObject, TargetOperatingSystem property of Win32_EnvironmentSpecification

Short VBS code - get a single specified instance of Win32_EnvironmentSpecification class or get a default unnamed instance (singleton) of the class, using one single command GetObject with exact path of the wmi object.

'https://wutils.com/wmi/
Dim wmiObject
Set wmiObject = GetObject( _
 "WINMGMTS:\\.\ROOT\cimv2:" + _
 "Win32_EnvironmentSpecification.CheckID=""Env_OANOCACHE_ONE_3{D64B6984-242F-32BC-B008-752806E5FC44}""")
Wscript.Echo wmiObject.TargetOperatingSystem 'or other property name, see properties
See more VBS samples of Win32_EnvironmentSpecification class

WMI query - sample windows WQL with C#, TargetOperatingSystem property of Win32_EnvironmentSpecification

Get a specified instance of Win32_EnvironmentSpecification by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
See in another language: VBScript, VB.Net.
//https://wutils.com/wmi/

//Project -> Add reference -> System.Management
//using System.Management;

//create a management scope object
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\cimv2");

//create object query
ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_EnvironmentSpecification Where CheckID=\"Env_OANOCACHE_ONE_3{D64B6984-242F-32BC-B008-752806E5FC44}\"");

//create object searcher
ManagementObjectSearcher searcher =
                        new ManagementObjectSearcher(scope, query);

//get a collection of WMI objects
ManagementObjectCollection queryCollection = searcher.Get();

//enumerate the collection.
foreach (ManagementObject m in queryCollection) 
{
  // access properties of the WMI object
  Console.WriteLine("TargetOperatingSystem : {0}", m["TargetOperatingSystem"]);
  
}

WMI query - sample windows WQL with VB.Net, TargetOperatingSystem property of Win32_EnvironmentSpecification

Get a specified instance of Win32_EnvironmentSpecification by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
See in another language: VBScript, C#
'Project -> Add reference -> System.Management
'Imports System.Management

'Get the namespace management scope
Dim Scope As New ManagementScope("\\.\ROOT\cimv2")

'Get a result of WML query 
Dim Query As New ObjectQuery("SELECT * FROM Win32_EnvironmentSpecification Where CheckID="Env_OANOCACHE_ONE_3{D64B6984-242F-32BC-B008-752806E5FC44}"")

'Create object searcher
Dim Searcher As New ManagementObjectSearcher(Scope, Query)

'Get a collection of WMI objects
Dim queryCollection As ManagementObjectCollection = Searcher.Get

'Enumerate wmi object 
For Each mObject As ManagementObject In queryCollection
  'write out some property value
  Console.WriteLine("TargetOperatingSystem : {0}", mObject("TargetOperatingSystem"))
Next
comments powered by Disqus
WUtils.com