fowmow Posted August 15, 2007 Share Posted August 15, 2007 No, the Process* functions are not suitable. One would need to know the actual name of the process or PID. Basically, I just want to know if any functions exist currently to monitor and locate services in Windows XP? Before I redesign the wheel that is. I've got a marvel idea, but it would be much nicer if I could simplify a few things. Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted August 15, 2007 Share Posted August 15, 2007 I don't know exactl what you want.. but you could look at http://www.autoitscript.com/forum/index.php?showtopic=29404Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
weaponx Posted August 15, 2007 Share Posted August 15, 2007 You can talk to XP / 2000 Service Controller sc.exe Link to comment Share on other sites More sharing options...
weaponx Posted August 15, 2007 Share Posted August 15, 2007 Show message box with all services: _listservices() Func _listservices() $strComputer = "." ;$strComputer = @ComputerName $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") If $objWMIService = 0 Then MsgBox(0,"","WMI Connection Failure") EndIf $colListOfServices = $objWMIService.ExecQuery ("Select * from Win32_Service ") $strServiceList = "" For $objService in $colListOfServices $strServiceList &= $objService.name & @CRLF Next MsgBox(0,"",$strServiceList) EndFunc Link to comment Share on other sites More sharing options...
fowmow Posted August 16, 2007 Author Share Posted August 16, 2007 I don't know exactl what you want.. but you could look at http://www.autoitscript.com/forum/index.php?showtopic=29404 Emiel Thanks for that link! Those UDFs look mighty nice. And basically, I just wanted to get a list of all internal service names so that I could pipe the list to a function. Show message box with all services: _listservices() Func _listservices() $strComputer = "." ;$strComputer = @ComputerName $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") If $objWMIService = 0 Then MsgBox(0,"","WMI Connection Failure") EndIf $colListOfServices = $objWMIService.ExecQuery ("Select * from Win32_Service ") $strServiceList = "" For $objService in $colListOfServices $strServiceList &= $objService.name & @CRLF Next MsgBox(0,"",$strServiceList) EndFuncoÝ÷ Ûú®¢×Áë(æðyªhÛN§Í÷#¬iËnjYrv§Øb±«¢+ØÀÌØíÁ¥ôIÕ¸¡ ½µMÁµÀìÅÕ½Ðì½ÅÕ½ÐìµÀìÅÕ½ÐíÍÅÕÉäÍÑÑô±°ñ¥¹ÍÑÈÅÕ½ÐìÅÕ½ÐíMIY% }95ÅÕ½ÐìÅÕ½ÐìÅÕ½Ðì°MåÍѵ¥È°M]}!%°ÀÌØíMQ=UQ} !%1¤(ÀÌØí±ôQÉÕ)]¡¥±ÀÌØí±ôQÉÕ(ÀÌØí±¥¹ôMÑÉ¥¹IáÁIÁ±¡MѽÕÑI ÀÌØíÁ¥¤°ÅÕ½ÐíMIY% }95èÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤(%ÉɽÈQ¡¸á¥Ñ1½½À(5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí±¥¹¤(ÀÌØí±ô±Í)]¹ More than one way to skin a cat I guess! Link to comment Share on other sites More sharing options...
weaponx Posted August 16, 2007 Share Posted August 16, 2007 The problem I have with COM objects and WMI is that I don't know the capabilities of it. I have no clue what functions are available without digging into google. With command line tools I have most of the documentation on my pc. Link to comment Share on other sites More sharing options...
fowmow Posted August 18, 2007 Author Share Posted August 18, 2007 The problem I have with COM objects and WMI is that I don't know the capabilities of it. I have no clue what functions are available without digging into google. With command line tools I have most of the documentation on my pc. I'd have to agree. Windows scripting and the like is not familiar territory. I wasn't even aware I could poll WMI as a COM object until I saw you use it. Which by the way, thanks... it opened up a whole new world. It's much easier to poll it then to use regular expressions to extract from SC queries. And speaking of which: %windir%\hh.exe ms-its:%windir%\Help\ntcmds.chm::/sc.htm This tells me to click on the different SC commands available, but none are available... at least not on my machine. Anyway, since you do have a particular knowledge of this, have you checked out Script-O-Matic and WMI Code Creator? Both are freely available from the Microsoft Web site. Thanks again for your help. Your lead led me to *several* areas that have simplified my project. Link to comment Share on other sites More sharing options...
ptrex Posted August 19, 2007 Share Posted August 19, 2007 @All If I understand the question correctly, this is what you are looking for : taskList.exe /SVC You can pipe the output if needed regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
fowmow Posted August 20, 2007 Author Share Posted August 20, 2007 (edited) ptrex, that would seem to be one solution. However, the problem is that its primary return is the process *not* the *service*.Therefore, for example, one might get a list of svchost.exe's rather than the actual name of the services that invoke svchost.exe.Another caveat is that it only reports on running processes (services).I am not intimately familiar with its use, but a quick glance at its instructions and flags lead me to believe it is not idyllic in this situation.Thanks for the feedback though! It is appreciated. Edited August 20, 2007 by fowmow Link to comment Share on other sites More sharing options...
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