WMI Explorer Problem with Spaces

General chat about HostMonitor
Post Reply
rollohmasker
Posts: 16
Joined: Mon Jan 08, 2007 6:32 am

WMI Explorer Problem with Spaces

Post by rollohmasker »

Hello,
i have a question about the wmiexplorer.
I have 10 processes named Service.exe, and the only difference i can find is the Property CommandLine with the Value "C:\Program Files\TXN Systems\Txn\Service.exe" -id 39

In the wmiexplorer i created the following query.
But it doesn`t work. I think it is a problem with the spaces in the CommandLine String.
select VirtualSize from Win32_Process where name='Service.exe' AND CommandLine=' "C:\Program Files\TXN Systems\Txn\Service.exe" -id 39'

Do you see what I did wrong in this case?
Best regards
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You are using single and double quotation marks for 1 variable. In such case you should use backslash (\) to quote special symbols like \ or ".
For example your query should look like
select VirtualSize from Win32_Process where name="Service.exe" AND CommandLine="\"C:\\Program Files\\TXN Systems\\Txn\\Service.exe\" -id 39"

Regards
Alex
Post Reply