Announcement

Collapse
No announcement yet.

Kill PID process

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

  • 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

  • #2
    You can find this in the product documentation: System.TerminateProcess()

    Ulrich

    Comment


    • #3
      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?

      Comment


      • #4
        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

        Comment


        • #5
          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

          Comment

          Working...
          X