Roman Posted April 30, 2009 Posted April 30, 2009 (edited) Hi I want to query a description from a specific process, e.g. "Program.exe"? Peace of cake i thought: Dim $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $o_ColListOfProcesses = $oWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'Program.exe'") For $o_ObjProcess in $o_ColListOfProcesses MsgBox(0, "Description", $o_ObjProcess.Description) Next But this dosn't work. I get back the process name, not its description. In fact, no one of this properties gives me back the description: Dim $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $o_ColListOfProcesses = $oWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'Program.exe'") For $o_ObjProcess in $o_ColListOfProcesses MsgBox(0, "Caption", $o_ObjProcess.Caption) MsgBox(0, "CommandLine", $o_ObjProcess.CommandLine) MsgBox(0, "CreationClassName", $o_ObjProcess.CreationClassName) MsgBox(0, "CSName", $o_ObjProcess.CSName) MsgBox(0, "Description", $o_ObjProcess.Description) MsgBox(0, "ExecutablePath", $o_ObjProcess.ExecutablePath) MsgBox(0, "Handle", $o_ObjProcess.Handle) MsgBox(0, "Name", $o_ObjProcess.Name) MsgBox(0, "OSCreationClassName", $o_ObjProcess.OSCreationClassName) MsgBox(0, "OSName", $o_ObjProcess.OSName) MsgBox(0, "WindowsVersion", $o_ObjProcess.WindowsVersion) Next Any ideas? Kind regards, Roman. Edited April 30, 2009 by roman
99ojo Posted April 30, 2009 Posted April 30, 2009 Hi I want to query a description from a specific process, e.g. "Program.exe"? Peace of cake i thought: Dim $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $o_ColListOfProcesses = $oWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'Program.exe'") For $o_ObjProcess in $o_ColListOfProcesses MsgBox(0, "Description", $o_ObjProcess.Description) Next But this dosn't work. I get back the process name, not its description. In fact, no one of this properties gives me back the description: Dim $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $o_ColListOfProcesses = $oWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'Program.exe'") For $o_ObjProcess in $o_ColListOfProcesses MsgBox(0, "Caption", $o_ObjProcess.Caption) MsgBox(0, "CommandLine", $o_ObjProcess.CommandLine) MsgBox(0, "CreationClassName", $o_ObjProcess.CreationClassName) MsgBox(0, "CSName", $o_ObjProcess.CSName) MsgBox(0, "Description", $o_ObjProcess.Description) MsgBox(0, "ExecutablePath", $o_ObjProcess.ExecutablePath) MsgBox(0, "Handle", $o_ObjProcess.Handle) MsgBox(0, "Name", $o_ObjProcess.Name) MsgBox(0, "OSCreationClassName", $o_ObjProcess.OSCreationClassName) MsgBox(0, "OSName", $o_ObjProcess.OSName) MsgBox(0, "WindowsVersion", $o_ObjProcess.WindowsVersion) Next Any ideas? Kind regards, Roman.Hi, i'm using ScriptomaticV2.hta to execute WMI queries beforehand to control the output. I did it with your WMI Class as well. In most cases the description is the same as the name of the executable. ;-)) Stefan
LurchMan Posted April 30, 2009 Posted April 30, 2009 what sort of description are you trying to get? Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.
Roman Posted April 30, 2009 Author Posted April 30, 2009 (edited) Hi,i'm using ScriptomaticV2.hta to execute WMI queries beforehand to control the output. I did it with your WMI Class as well. In most cases the description is the same as the name of the executable.;-))StefanHi Stefan and LurchManScriptomatic is a good idea; i didn't remember this tool...But the problem is not resolved. For example; in the Task Manager, the process "explorer.exe" has the description "Windows Explorer".If i try this with Scriptomatic, it returns under "Description" only "Explorer.exe"Or process "csrss.exe" with description "Client Server Runtime Process"; i get back the description "csrss.exe"But isn't it possible to get the string "Windows Explorer" resp. "Client Server Runtime Process" back? Simply the same i can read in the Task Manager, column "Description"?Regards,Roman. Edited April 30, 2009 by roman
LurchMan Posted April 30, 2009 Posted April 30, 2009 in windows XP i dont see any where in task manager for process description...i remember seeing it in Process Explorer from sysinternals but im not sure how they did it.... Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.
Roman Posted April 30, 2009 Author Posted April 30, 2009 in windows XP i dont see any where in task manager for process description...i remember seeing it in Process Explorer from sysinternals but im not sure how they did it....You are right; XP Task Manager does not show a description - Vista does.Don't know why and where Vista takes it from.So i have to try somethin else...Kind regards,Roman.
GEOSoft Posted April 30, 2009 Posted April 30, 2009 Take a look at FileGetVersion ( $FileName ,"FileDescription" ) using $o_ObjProcess.ExecutablePath to get $FileName George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Roman Posted May 1, 2009 Author Posted May 1, 2009 Take a look at FileGetVersion ( $FileName ,"FileDescription" ) using $o_ObjProcess.ExecutablePath to get $FileNameHi GEOSoftSorry, i can't understand what you are meaning.I'm not sure we speak about the same? Or can you refine your hint?Regards, Roman.
GEOSoft Posted May 1, 2009 Posted May 1, 2009 (edited) Dim $oWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") $o_ColListOfProcesses = $oWMIService.ExecQuery ("SELECT * FROM Win32_Process WHERE Name = 'Program.exe'") For $o_ObjProcess in $o_ColListOfProcesses MsgBox(0, "Caption", $o_ObjProcess.Caption) MsgBox(0, "CommandLine", $o_ObjProcess.CommandLine) MsgBox(0, "CreationClassName", $o_ObjProcess.CreationClassName) MsgBox(0, "CSName", $o_ObjProcess.CSName) MsgBox(0, "Description", $o_ObjProcess.Description) MsgBox(0, "ExecutablePath", $o_ObjProcess.ExecutablePath) MsgBox(0, "File Description", FileGetVersion($o_ObjProcess.ExecutablePath, "FileDescription") MsgBox(0, "Handle", $o_ObjProcess.Handle) MsgBox(0, "Name", $o_ObjProcess.Name) MsgBox(0, "OSCreationClassName", $o_ObjProcess.OSCreationClassName) MsgBox(0, "OSName", $o_ObjProcess.OSName) MsgBox(0, "WindowsVersion", $o_ObjProcess.WindowsVersion) Next Edited May 1, 2009 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now