wmi

Obtaining GUID for Existing USB Device on Windows XP

假装没事ソ 提交于 2019-12-12 17:15:52
问题 I need to find the GUID for an existing USB device attached to my Windows XP system. How can this be done using WMI or the registry? Or, is there another avenue that I should explore? Thanks. Additional Information: I need to find the GUID for a specific known device; it is not expected to change. If I need to write a little program, use some tool, or look somewhere in the Windows system to find this information, it's all the same to me. 回答1: For a specific known device, the easiest way I've

How to query specific adapters in Win32_PerfFormattedData_Tcpip_NetworkInterface?

随声附和 提交于 2019-12-12 17:08:31
问题 How can I query specific adapters (ideally based on the IP address) from Win32_PerfFormattedData_Tcpip_NetworkInterface? I've spent a while googling this issue, but I didn't come up with a solution. I tried using Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration, however, I cannot link these to the performance data. As I happen to have more than one network adapter on certain systems I cannot differentiate which adapter the returned values belong to - any ideas? 回答1:

How to change file permissions with WMI?

时光总嘲笑我的痴心妄想 提交于 2019-12-12 15:34:48
问题 I'm want to do the equivalent of what is described here from a script. Basically, I want to take ownership of the file, and set the permissions to OWNER/Full Control. It seems to me that using WMI from a vbs script is the most portable way. That is, I'd like to avoid xcacls, icacls and other tools that either require a download, or are supported only on some versions of windows. After googling around, I found this code for taking ownership: 'connect to WMI namespace on local machine Set

C# code to find all office updates installed

痞子三分冷 提交于 2019-12-12 15:27:14
问题 In add or remove programs you can view list of updates/patches for MS office Outlook. Is there a way to get this information using c# code. We tried WMI code const string query = "SELECT HotFixID FROM Win32_QuickFixEngineering"; var search = new ManagementObjectSearcher(query); var collection = search.Get(); foreach (ManagementObject quickFix in collection) Console.WriteLine(quickFix["HotFixID"].ToString()); This only lists windows updates. Is there a way to list updates for office components

Can I use WMI to manage WSD devices (specifically printers)?

徘徊边缘 提交于 2019-12-12 15:23:38
问题 I am using WMI with C# to enumerate and modify the printers on my computer. I'm running Windows 7, and everything is working fine when I try to modify printers that are installed "classically". By "classically", I mean that the printer is just using a basic TCP/IP Port. I can rename it, set it as the default printer, etc. using the documented WMI functions here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394363(v=vs.85).aspx. However, by default Windows is installing my printer

How Can I Correlate Logical Drives and Physical Disks using the WMI and Delphi?

丶灬走出姿态 提交于 2019-12-12 14:36:12
问题 I already have a long working on an application that can read information from Micro, some (most) failed more still missing some, I'm working with WMI and Delphi. The problem I'm facing is that I need to be listed units which belong to each HD, for example: HD1 has drive C:, D: and so on. thank you 回答1: To correlate the Logical Drives and Physical Disks you must use the Win32_DiskDrive class and the Win32_DiskDriveToDiskPartition, Win32_LogicalDiskToPartition ASSOCIATORS classes. Try this

Calling a method of a WMI Class

我只是一个虾纸丫 提交于 2019-12-12 14:13:46
问题 I'm attempting to call the following method: https://msdn.microsoft.com/en-us/library/dn469242(v=vs.85).aspx The corresponding powershell is: wmic /namespace:\\ROOT\Microsoft\Windows\DesiredStateConfiguration class MSFT_DSCLocalConfigurationManager call GetConfigurationStatus I can't quite figure out how to do it correctly using go-ole. Here's what I have so far. It fails with: invoke_test.go:47: wmi: error calling method GetConfiguration: Exception occurred. Generic failure ) When I try

64bit equivalent class for a wmi class “win32reg_addremoveprograms”?

扶醉桌前 提交于 2019-12-12 14:00:13
问题 My code below works perfectly on a 32-bit Windows machine, however it refuses to work on a 64-bit machine due to the 32-bit WMI class win32reg_addremoveprograms used in the code. Is there a 64-bit equivalent of this class? $ServerFile = "D:\SharePoint\Powershell\AddRemovePrograms\Machines.txt" $ServerList = Get-Content $ServerFile $Excel = New-Object -Com Excel.Application $Excel.displayalerts=$False $Excel.visible = $True $workbook = $Excel.Workbooks.Add() $workbook.workSheets.item(2).delete

How come the “SerialNumber” property of the “Win32_CDROMDrive” class returns null when asking for it separately from WMI?

有些话、适合烂在心里 提交于 2019-12-12 13:16:09
问题 When acquiring the value of the property SerialNumber from the WMI class Win32_CDROMDrive like this SELECT SerialNumber FROM Win32_CDROMDrive it throughs a NullReferenceException unless i change the query to SELECT * FROM Win32_CDROMDrive . Then loop arround all the properties including the SerialNumber in-which in that case is not null. And since the first method is faster than the second (not quite sure) I prefer to use it. So what is happening? Am I missing something? Note that it works

How can I get an exit code from WMI spun remote process

谁说胖子不能爱 提交于 2019-12-12 12:21:01
问题 I'm executing a process remotely via WMI (Win32_Process Create) but am unable to figure out how I can determine when the process has completed executing. When I first issue the command, there is an exit code (0 for success) but that just tells me the process has been successfully spawned. Is there a way I can know when the process ends? Thanks! 回答1: Faced same issue and wrote a simple VMI wrapper: var exitStatus = WmiOperations.Run("notepad.exe", wait:10); Synopsis for Run is: int Run(string