i have a file in "C:\Documents and Settings\Administrator\Application Data\" with name Protector-(random 4 letters).exe . so you can see that the name of the file is random.
now i want to write a c++ code to kill this file's process. plz tell me that code to kill this file. i found ShellExecute() function to run a command (taskkill) and kill the process but i dont know how i can kill a process with random name by this function! this is a code that i found for ShellExecute():
ShellExecute(NULL, L"open", L"C:\\WINDOWS\\system32\\cmd.exe ", L"taskkill /f /fi ""IMAGENAME eq Protector-(random 4 letters).exe""", NULL, SW_SHOWNORMAL);
See Taskkill /?
Taskkill supports the Wildchar *
character
ShellExecute(NULL, L"open", L"C:\\WINDOWS\\system32\\cmd.exe", L"taskkill /f /im \"Protector-*\"", NULL, SW_SHOWNORMAL);