Currently with WMI's Win32_Process, I seem unable to detect if a batch file is currently running
all it lists is CommandLine of cmd.exe, without telling me which batch file that particular cmd.exe is running. Anybody have any insights there?
code snippet (ruby-wmi)
many_args = 'batch_file.bat'
procs = WMI::Win32_Process.find(:all)
procs.each{|proc|
if (proc.CommandLine.contain?(many_args)) || proc.Name.include?(many_args) # never succeeds
...
end
}