Skip to content
Advertisement

How to fix the program won’t show other results

I have the following problem

JavaScript

In this code that detects if the program is open and closes it, no matter how I change it, it always says Process is not running.

Advertisement

Answer

The output of your script is depending on the line if(c.Win32_Process(name=rty)) – it seems the return of Win32_Process is always True.

  • Insert a print statement with the value of Win32_Process before this line
  • Have you tried to provide the argument as a String (“StrA” instead of StrA)?

To check all current running processes, use:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement