Closing the program

Good day. I need to make the closure of all processes, because when you close the application, some AXAJ processes hang then endlessly.
When the application name is without a space, it works perfectly:

procedure OnPubBeingClosed;
begin
  RunAProgram("cmd", "/c taskkill /F /im APPName.exe", "", false, SW_HIDE);  
end;  

When in the name of the application there is a space I can not do, because the name of the application must be quoted.
Sorry for my English.

To have a quote char, you can use double quotes ""

procedure OnPubBeingClosed;
begin
  RunAProgram("cmd", "/c taskkill /F /im ""APP Name.exe""", "", false, SW_HIDE);  
end;

Thank you. Another question: is there a variable that contains the name of the program?

Sure, check this list:
https://www.htmlexe.com/help/globalvariables#list-of-pre-defined-global-variables