I am running couple of wmic commands in a btach file to find a process and killing it.
wmic Path win32_process Where "CommandLine Like '%app1%'" Call Terminate
wmic Path win32_process Where "CommandLine Like '%app2%'" Call Terminate
These commands run fine when I run from console individually but when I run them using a batch file , I get error as below:
wmic Path win32_process Where "CommandLine Like ''" Call Terminate
No Instance(s) Available.
Can someone point out whats the issue with the command if its run from a batch file.