Unable to terminate a Windows process

Running Windows 7, I am trying to create a batch file to terminate a Windows process with "taskkill".  It is an executable file with the path: "C:\Program Files\FreeFileSync\Bin\RealtimeSync_W32.exe"    If I include the entire path, the error is: "invalid query".  If I include only the name of the executable file, the error is: "process does not exist."
ddantesAsked:
Who is Participating?
 
Amit KhilnaneyConnect With a Mentor Commented:
just copy the command in a notepad and save the file as "xyz.bat"

Include the quotes while saving a file and save as type "All types"
0
 
KeldenCommented:
try:

taskkill /F /IM RealtimeSync_W32.exe

/F will force the termination
/IM is needed to find the right process
0
 
ddantesAuthor Commented:
Thank you for your comment.  As it turns out, there is a parent process (RealtimeSync.exe) which causes the RealtimeSync_W32.exe to launch.  Terminating the parent process, and forcing termination of the child process works:

taskkill /IM "RealtimeSync.exe" /F /T

Would you mind showing me how to convert this command line to a batch file?
0
 
ddantesAuthor Commented:
Works like a charm.
0
All Courses

From novice to tech pro — start learning today.