I need a little of your help in this simple script. I am trying to create a script that run a “taskkill” by reading the windows title , but I dont know how to make it run in C++ . As I know in batch will be really easy
system("TASKKILL /F /FI "WINDOWTITLE eq Notepad*"");
But when I try to do that in C++
#include <iostream>
#include <cstdlib>
int main()
{
using namespace std;
system("TASKKILL /F /FI "WINDOWTITLE eq Notepad*"");
}
I am not able to compile it! I got this in DevC++
[Error] expected ‘)’ before ‘WINDOWTITLE’
I am sure that the problem is set on that “_” needed to be able to run Windowstitle , but without that it will not work.
Any advice?
Thanks !
Escape the quotation marks: