wmi

How to print a test page and capture the return value for a non default printer on a remote server using WMI's PrintTestPage method?

故事扮演 提交于 2019-12-12 05:36:12
问题 I'm using the System.Management namespace along with WMI to install printers/ports on a remote server. Once the printer/port is installed, I'd like to print a test page, capture whether or not printing the test page was (theoretically) successful, and display the result to the user. I've got everything working up until the point of printing the test page. I've seen this article, as well as this article, on the subject, but neither one quite seems to be doing the trick because I'm not seeing

Getting Machine Serial Number With WMI Class [duplicate]

有些话、适合烂在心里 提交于 2019-12-12 04:53:23
问题 This question already has answers here : Getting Service Tag from Dell Machine using .net? (4 answers) Closed 5 years ago . I wrote this part of c# WMI Code for getting MotherBoard serial Number ManagementObjectSearcher ComSerial = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard"); foreach (ManagementObject wmi in ComSerial.Get()) { try { MainBoard.Text = wmi.GetPropertyValue("SerialNumber").ToString(); } catch { } } But in fact i want to learn PC(Machine) Serial Number(Written On

How to get from device-manager device (e.g. from its “Physical Device Object name”) to its drive-letter?

℡╲_俬逩灬. 提交于 2019-12-12 04:36:26
问题 From the device manager, I have a USB device node. I extracted its "Physical Device Object name" (e.g. \Device\0000010f ). Fighting for hours with NtOpenDirectoryObject , NtQueryDirectoryObject , NtOpenSymbolicLinkObject , NtQuerySymbolicLinkObject and QueryDosDevice , I couldn't find a way to get from that "Physical Device Object name" to the actual drive-letter ( C: , D: , ...). I'm looking for any storage solution (USB/SATA/...). How do I do that? (There are many similar questions, none of

Get the Startup List via WMI

这一生的挚爱 提交于 2019-12-12 04:28:03
问题 How do I gat the the full .exe path Let us assume with the following string strt["Command"].ToString(); I get this output C:\Program Files\Analog Devices\SoundMAX\soundmax.exe /tray but how to I get C:\Program Files\Analog Devices\SoundMAX\soundmax.exe ManagementClass mangnmt = new ManagementClass("Win32_StartupCommand"); ManagementObjectCollection mcol = mangnmt.GetInstances(); foreach (ManagementObject strt in mcol) { string[] lv = new String[4]; lv[0] = strt["Caption"].ToString(); lv[1] =

Is there any C++ library to work with WMI? [closed]

梦想的初衷 提交于 2019-12-12 03:45:00
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I'm working on a big project that have to poll remote WMI counter. I have to code a Win32 app in C++ to query WMI from remote Windows systems. So, Is there any C++ library (free or paid) help me to work with WMI ? Please help me. Thanks so much :) 回答1: You can use the WMI Delphi Code Creator to generate C++ code

WMI Memory leak solution

喜你入骨 提交于 2019-12-12 03:23:47
问题 I have a static method that invokes WMI management objects and serializes the result. It works well enough, but it leaks memory like a sieve. About 20k every time I run it. (even with all of the serialization turned off). I've tested in .Net 2.0, 3.0, 3.5 and the memory leak is constant throughout. Am I doing something wrong? Or is there a way to box this method so that what ever leak it has, is thrown out when it finishes. (like boxing it in a child process) using (ManagementObjectSearcher

How to configure Windows Group Policy using c++?

我们两清 提交于 2019-12-12 03:12:37
问题 I am working on IE BHO toolbar. When I install it for IE 8, it works fine. In case of IE 9, It pops up an info bar asking if to enable it. I know what settings to change in group policy manually. I just do not know how to do it in programming. Changes to make are in Group Policy: Location : User Config > Administrative Template > Windows Components > IE > Security Features > Add-on Management Modifications: Set Add-on list to enabled Add an entry in Add-on list Are there any straight forward

How to retrieve WMI data such as UUID from a C# program?

强颜欢笑 提交于 2019-12-12 02:12:57
问题 To retrieve system's UUID we have the option of WMIC command-line utility wmic csproduct get uuid How to retrieve the same uuid from a system using C or C# program or using .dll? 回答1: You can get the Universally unique identifier (UUID) value from the Win32_ComputerSystemProduct WMI class, try this sample. using System; using System.Collections.Generic; using System.Management; using System.Text; namespace GetWMI_Info { class Program { static void Main(string[] args) { try { string

I want to use WMI or Java in ColdFusion on Windows to get performance data

对着背影说爱祢 提交于 2019-12-12 01:33:04
问题 I am rolling my own simple web-based perfmon, I am not happy with some of the data I can get like cpu usage, which i use via a sql query. I am able to get memory usage just fine...I will attach a screenshot, so you can see what I currently have for my main/home/dashboard page. I am currently using webcharts3d, which i am loving being able to use ajax, update the chart, and i have a dynamically updating dashboard. Yes of course I have to get only a few performance counter's so in my desire to

How should the CIM_DataFile file name be passed to an inline ActiveScriptEventConsumer VBScript for a __InstanceCreationEvent WMI subscription?

本秂侑毒 提交于 2019-12-12 01:24:37
问题 I need to automate moving a file when created from one directory and only the file that triggered the event...not every file in the directory. I am trying to setup a WMI subscription using powershell and the ActiveScriptEventConsumer with an inline VBScript where I can pass the name of the file to the inline VBScript. PS> $evtConsumer.ScriptText = "WITH CreateObject(""Scripting.FileSystemObject"") >> .MoveFile """ $EventArgs.NewEvent.Name """, ""[target path here]"" >> END WITH" When I