A
Alex Blekhman
Hello,
I need to determine executable's subsystem from script. I
was thinking about using WMI for that.
Win32_FileSpecification class looks promising
(TargetOperatingSystem property). However, I cannot get
instance of Win32_FileSpecification for individual file.
While CIM_DataFile is easily retrievable, but doesn't
contain subsystem information. Here's short example:
------
strComputer = "."
Set objWMIService = GetObject(_
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery( _
"Select * from CIM_Datafile " & _
"WHERE Name='C:\\Windows\\notepad.exe'",,48)
For Each objItem in colItems
For Each prop in objItem.Properties_
Wscript.Echo prop.Name & ": " & prop.Value
Next
Next
I need to determine executable's subsystem from script. I
was thinking about using WMI for that.
Win32_FileSpecification class looks promising
(TargetOperatingSystem property). However, I cannot get
instance of Win32_FileSpecification for individual file.
While CIM_DataFile is easily retrievable, but doesn't
contain subsystem information. Here's short example:
------
strComputer = "."
Set objWMIService = GetObject(_
"winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery( _
"Select * from CIM_Datafile " & _
"WHERE Name='C:\\Windows\\notepad.exe'",,48)
For Each objItem in colItems
For Each prop in objItem.Properties_
Wscript.Echo prop.Name & ": " & prop.Value
Next
Next