wmi

Create WMI class and add static property or default value

喜欢而已 提交于 2021-02-05 08:29:05
问题 I'm trying to create a WMI class and add a static property, or set the default value of the property $WMI_Class = New-Object System.Management.ManagementClass("root\default", $null, $null) $WMI_Class.Qualifiers.Add("Static", $true) $WMI_Class.Properties.Add("ver", [System.Management.CimType]::String, "myDefaultValue") $WMI_Class.name = "MyCoreClass" $WMI_Class.Put() $obj = ([WmiClass] 'root\default:MyCoreClass') $ver = $obj.Properties['ver'].Value $ver The class is created but the $ver is

Parse CIM_DateTime with milliseconds to Java Date

断了今生、忘了曾经 提交于 2021-02-05 06:09:54
问题 I am trying to convert a DateTime value retrieved from Windows Management Interface into a Java (1.7) Date; ultimately to milliseconds since the epoch. The format is specified here. An example that I am trying to parse is 20160513072950.782000-420 which is 2016-05-13 at 07:29:50 plus 782 milliseconds, in my local timezone (-420 minutes = UTC-7 hours). The digits after the decimal are fractional seconds; in theory up to 6 digits of microseconds, but in practice only the first 4 digits are

Kill all processes with a certain name

六月ゝ 毕业季﹏ 提交于 2021-02-04 20:49:58
问题 I have an HTA that runs a backup routine. For the backup I'm using the SyncToy command line executable, which in some instances does not properly cease. Beacuse of this, I'm trying to kill any process with the name SyncToyCmd.exe . I make use of the window_onBeforeUnload event and call the KillSyncToy() sub from there. The function is correctly detecting instances of the SyncToyCmd.exe , however when trying to kill the process I'm receiving an error - Error: The system cannot find the file

Using Python and WMI Queries to get a list of running services

落爺英雄遲暮 提交于 2021-01-29 10:40:23
问题 I am attempting to get a list of services that are running on a windows machine with python. My Code: import wmi c = wmi.WMI() wql = "SELECT * FROM Win32_Service WHERE State = ""Running""" for x in c.query(wql): print(x) I am getting an error and I do not understand why. I have a few other wql statements in my script and they seem to be working fine. Error: Traceback (most recent call last): File "C:/Users/i861470/Desktop/Scripts/test.py", line 79, in <module> for x in c.query(wql): File "C:

Is there a way to obtain USB port IDs via Win32 API?

一个人想着一个人 提交于 2021-01-29 08:05:58
问题 I am in need of a way to obtain the IDs of the USB ports (if they exist) in a project I am working on. What we are trying to do is to connect some Asus depth cameras to a Windows-computer by using USB ports and in our application, which makes use of these cameras,to uniquely identify a camera because each camera has some specific information generated for it (some transformation matrices, etc.) and to reload this information for each camera, when we disconnect and reconnect the cameras to the

How can I know which HDMI port is plugged in?

耗尽温柔 提交于 2021-01-29 07:55:52
问题 I have a computer with a dual hdmi output. I would like to detect which one is plugged in when I connect a monitor to either to one of them. It can be either with the help of registry, powershell or C# code, or anything. As long as it's not C++. I've tried various wmi methods. Searched the registry for anything that would specify a hdmi port. But found nothing so far. This stackoverflow answer (Detect/identify the port (HDMI, other) the monitor is connected to in Windows 7/8/10 Win32 C++) is

Get Total CPU # via WMI or T-SQL

旧街凉风 提交于 2021-01-29 05:00:28
问题 I don't want the list of all process, just a total percentage like you would see in windows taskmanager. I will be using this information via coldfusion, but i am having all kinds of problems just trying to find a total number of current cpu usage. I don't care if it comes from wmi or t-sql, i just want a total number for which i will be using to populate a gauge chart that via ajax will be showing my current cpu usage percentage... Thank You... 回答1: You can use the Win32_PerfRawData_PerfOS

Querying WMI for D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY

瘦欲@ 提交于 2021-01-29 04:00:21
问题 I have followed this MSDN article which shows an example of retrieving WMI data from the local computer http://msdn.microsoft.com/en-us/library/windows/desktop/aa390423%28v=vs.85%29.aspx The example shown gets the name of the operating system, but in my case I am querying "Select * from WmiMonitorConnectionParams" and want to retrieve the D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY http://msdn.microsoft.com/en-us/library/windows/hardware/ff546605%28v=vs.85%29.aspx How should I use IWbemClassObject::Get

CCM_Application User available software missing

主宰稳场 提交于 2021-01-28 16:33:54
问题 While querying the namespace root\ccm\clientsdk class ccm_application I've found that it'll contain objects for any triggered application installs and not user available applications. Has anyone found a way around this? 回答1: From what you're saying I think this is by design with SCCM, but may be different in the more recent windows 10 versions. What I've seen with it is that applications made available to a User collection don't seem to appear in the local client classes. This makes sense

CCM_Application User available software missing

拈花ヽ惹草 提交于 2021-01-28 16:32:05
问题 While querying the namespace root\ccm\clientsdk class ccm_application I've found that it'll contain objects for any triggered application installs and not user available applications. Has anyone found a way around this? 回答1: From what you're saying I think this is by design with SCCM, but may be different in the more recent windows 10 versions. What I've seen with it is that applications made available to a User collection don't seem to appear in the local client classes. This makes sense