Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3140
  • Last Modified:

How to resolve: wmic exception error code 0x80020009, failure in formatengine.cpp

Hi,

When I try to execute any command using wmic, I get an exception with error code = 0x80020009. I've run wmdiag.exe and it shows no problems. I've appended partial output from trying to execute the "process" command using the "/trace:ON" option. Any help would be greatly appreciated.

Thanks!

Operating system: Windows Server 2003
Anti-virus: Kaspersky
RAM: 32 Gigs
CPU Name: Intel Xeon 5110

Partial output from executing "wmic /trace:ON process":


SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IWbemObjectTextSrc::GetText(0, -, WMI_OBJECT_TEXT_CIM_DTD_2_0, -, -)
Line:    413 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: IEnumWbemClassObject->Next(WBEM_INFINITE, 1, -, -)
Line:    446 File: d:\nt\admin\wmi\wbem\tools\wmic\execengine.cpp

SUCCESS: CoCreateInstance(CLSID_FreeThreadedDOMDocument, NULL, CLSCTX_INPROC_SER
VER, IID_IXMLDOMDocument2, -)
Line:    198 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXMLDOMDocument::loadXML(-, -)
Line:    229 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: CoCreateInstance(CLSID_XSLTemplate, NULL, CLSCTX_SERVER, IID_IXSLTempla
te, -)
Line:   3219 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: CoCreateInstance(CLSID_FreeThreadedDOMDocument, NULL, CLSCTX_SERVER,IID
_IXMLDOMDocument2, -)
Line:   3242 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXSLDOMDocument2::put_async(VARIANT_FALSE)
Line:   3254 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXSLDOMDocument2::load(L"C:\WINDOWS\system32\wbem\texttable.xsl", -)
Line:   3269 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXSTemplate::putref_stylesheet(-)
Line:   3283 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXSTemplate::createProcessor(-)
Line:   3295 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXSProcessor::put_input(-)
Line:   3332 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

SUCCESS: IXSProcessor::put_output(-)
Line:   3359 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

FAIL: IXSProcessor::tranform(-)
Line:   3373 File: d:\nt\admin\wmi\wbem\tools\wmic\formatengine.cpp

ERROR:
Code = 0x80020009
Description = Exception occurred.
Facility = Dispatch
0
dw_robert
Asked:
dw_robert
  • 7
  • 6
  • 4
1 Solution
 
dw_robertAuthor Commented:
An additional point: the server is running 64 bit Windows Server 2003 R2. Also, the amount of RAM is 2 Gigs rather than 32 Gigs.
0
 
ChiefITCommented:
Windows Management Instrumentation Command line (WMIC) has a limit of what it can do.

Your best bet to resolve is to place a question in the scripting zones and programming zones to come up with an alternative to the command line shell. Power shell might overcome these limitations. There are a lot of good code writers that can help you come up with an alternative to WMIC.

Please review the following Technet article for verification:
http://www.tech-archive.net/Archive/WinXP/microsoft.public.windowsxp.wmi/2004-11/0007.html
0
 
dw_robertAuthor Commented:
ChiefIT,

Thanks for your response. However, I should add more information about what I'm trying to do, and why I've been looking at WMIC.

I'm writing a Perl script that will go through the currently running Windows processes and operate on certain ones that it identifies. I want to use WMIC to get a list of those processes from the Perl script. So I don't think Powershell is an option. (Am I wrong?)

I've tested WMIC to see if it will get the list of processes, and it works properly on all of our servers except for one. That server is one we've used for testing, and, as a result, its configuration seems to be  messed up. So I'm trying to figure out how to get that server working with WMIC.

I'm open to finding alternatives to WMIC to getting a list of processes, but I haven't been able to find anything that provides all the information we need. In particular, I need to get not only the executable path and process ID, but also the commandline parameters. The Perl module Win32::Process::Info provides the first two things but not the third, and, in any case, it's not clear it would be very reliable.
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
ChiefITCommented:
Do you need a list of ALL processes on the machine you are querying.

0
 
ChiefITCommented:
Have you looked at the MSDN VBS scripts for processes under the WMI components?

http://msdn.microsoft.com/en-us/library/aa394599(VS.85).aspx
0
 
dw_robertAuthor Commented:
ChiefIT,

Yes, I need a list of all processes.

I looked at the link you sent for the VBS scripts. Something like them, translated into Perl, might work. However, they're more involved than wmic, so I was hoping to get by with it. Also, I need something that will run on both 32- and 64-bit Windows Server 2003. I thought using wmic would be more portable, though I don't know for sure. Do you have any idea how portable the scripts would be?

Thanks for your help.
0
 
ChiefITCommented:
OK, I stink at scripting:

So, let's get a moderator on here to put you in the correct zones for a script that will work for you and is scalable enought to work for you.

0
 
ChiefITCommented:
dw_robert:

We know what's causing the error, but many code writers probably haven't see the error. So, I suspect this is causing the lack of participation. The code writers may be intimidated by the error you are seeing.

It might be best to consider re-writing your question without the error and asking for help code that does what you want.

I would like to bring your attention to a command line shell called tasklist:
http://technet.microsoft.com/en-us/library/bb491010.aspx

It will list the processes running, and I think you can run this on a remote computer.

Also there are a lot of third party tools that run in the background what will display the processes of any given client. They use these for monitoring for viruses and spyware.

 

0
 
RobSampsonCommented:
Hi, this VBS code will list all processes on a computer. The VBS needs to be executed with something like
cscript.exe MyScript.vbs <computername>

I'm not sure if PERL uses CScript.exe to execute scripts, but see if it helps.

Also, not sure if you've tried this, but on the machine that fails, check that DCOM is enabled, and make sure it has the correct permissions to allow COM objects to run.  Click Start --> Settings --> Control Panel --> Administrative Tools --> Component Services
Then expand Component Services --> Computers --> My Computer
Right click My Computer, go to Properties.  On the Default Properties tab, check the Enable Distributed COM on this computer box.
Then on the COM Security tab, click Edit Default... under Launch and Activation Permissions and make sure the Local Administrators group has Full Access.
Then make sure that your domain account is in the Local Administrators group in Computer Management.  Restart the system and try again.

Also, just double check the registry setting for DCOM is enabled:
HKLM\Software\Microsoft\OLE\
String value: EnableDCOM
should be Y

Regards,

Rob.
On Error Resume Next
strComputer = WScript.Arguments.Item(0)
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
Set colProcess = objWMIService.ExecQuery("Select Name from Win32_Process")
For Each objProcess In colProcess
	WScript.Echo objProcess.Name
Next
If Err.Number <> 0 Then WScript.Echo "An error occurred getting processes from " & strComputer

Open in new window

0
 
dw_robertAuthor Commented:
I was going to follow Rob's suggestions to try to get WMIC working but, for some reason, WMIC started working. I have no idea why.
0
 
RobSampsonCommented:
Well that's odd, but good news!  You can request that this question be deleted, or you could accept your last comment as the answer....

Regards,

Rob.
0
 
ChiefITCommented:
@Rob:

I don't think it's as odd as you might think. The error he was running into stemmed from the limitations of the command line shell.

review this comment for clarification:
12/30/09 12:48 PM, ID: 26149588

I think the author needed a script that can do more than the WMIC. If he starts a few more services, I'll bet the error pops back up again.
0
 
dw_robertAuthor Commented:
Rob and ChiefIT,

A couple of comments. First, I wasn't clear that I need more than a list of running tasks: for what I'm doing, I also need the entire command line, including the command line parameters. I looked at tasklist, but so far as I can tell, it doesn't provide the parameters, which is why I didn't use it. Also, it's not clear to me the problem was due to a limitation on WMIC. I tried it on several machines, and the only machine it didn't work on was one that was running fewer processes than the others, and it also failed when I ran it in safe mode. Further, I wasn't able to get ANY WMIC commands to work.

In any case, thanks for all the good information and suggestions. I'm using WMIC because I want to get up and running as quickly as possible, and because it looks like it's portable. But I may eventually switch to a Perl version of Rob's VB script.
0
 
RobSampsonCommented:
Hi, in my VBScript code, instead of these lines


Set colProcess = objWMIService.ExecQuery("Select Name from Win32_Process")
For Each objProcess In colProcess
        WScript.Echo objProcess.Name
Next


if you use this


Set colProcess = objWMIService.ExecQuery("Select Name,CommandLine from Win32_Process")
For Each objProcess In colProcess
        WScript.Echo objProcess.Name & " - " & objProcess.CommandLine
Next



does that give you enough info to get the command line arguments?

Regards,

Rob.
0
 
dw_robertAuthor Commented:
Rob,

Thanks for the suggestion. I have WMIC working now, so that's what I'm using. I may see about switching to your method eventually, however, and, if I do, I'll let you know if your most recent suggestion works.

Steven
0
 
RobSampsonCommented:
Sure. Well I don't know PERL, so I can't help you there....

Regards,

Rob.
0
 
ChiefITCommented:
I am glad to see things are working for you.

Programming is not my cup of tea.

So, I am no further use here.

Thanks Rob, for stopping in.

I am checking out now.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 7
  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now