Announcement

Collapse
No announcement yet.

Kill all running .bat apps?

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

  • Kill all running .bat apps?

    This does not work?


    i
    1. nstances_of_file = 0;
    2. file_to_check_for = "autorun.exe"; --have all lowercase
    3. processes = System.EnumerateProcesses();
    4. for j, file_path in pairs(processes) do
    5. file = String.SplitPath(file_path);
    6. if (String.Lower(file.Filename..file.Extension)) == file_to_check_for then
    7. System.TerminateProcess(j);
    8. end
    9. end

  • #2
    sorry , I ment

    instances_of_file = 0;
    file_to_check_for = "*.bat"; --have all lowercase
    processes = System.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
    System.TerminateProcess(j);
    end
    end

    Comment


    • #3
      just kill "cmd.exe"

      Comment

      Working...
      X