Announcement

Collapse
No announcement yet.

Kill PID process

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • telco
    replied
    thanks ulrich, but im afraid because totally i dont know how to do it with the code using window enumerat process or system terminate process..

    whats in my mind is when i run the app i will put the PID in label, and there is one button to terminate the PID.

    i found this ex in documentation: but i think is different to what i want.

    instances_of_file = 0;
    file_to_check_for = "autorun.exe"; --have all lowercase
    processes = Window.EnumerateProcesses();

    for j, file_path in pairs(processes) do
    file = String.SplitPath(file_path);
    if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
    instances_of_file = instances_of_file + 1;
    end
    end

    if instances_of_file > 1 then
    Window.Hide(Application.GetWndHandle());
    Dialog.Message("Error", "Autorun already running: code: already running");
    Window.Close(Application.GetWndHandle(), CLOSEWND_TERMINATE);
    else
    Window.Show(Application.GetWndHandle());
    end

    Leave a comment:


  • Ulrich
    replied
    The command works properly. If you are unable to make it work, please post your exported project (*.apz), so one can see what you are actually doing.

    Ulrich

    Leave a comment:


  • telco
    replied
    i am having trouble also with this command..
    i am trying System.TerminateProcess but no luck on how to do it.. newbie here...
    the same process as above.. how can i get the PID of my application? or other application?

    Leave a comment:


  • Ulrich
    replied
    You can find this in the product documentation: System.TerminateProcess()

    Ulrich

    Leave a comment:


  • dvbappx
    started a topic Kill PID process

    Kill PID process

    How to kill the exe that has a process ID

    I have more running exe in the process want to kill only certain pid
Working...
X