Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- With this function you can end (terminate) a process easily by just typing the name of the process in the function.
- -- The function
- function System.EndProcess(strProcess)
- strProcess = String.Lower(strProcess);
- tblProcesses = System.EnumerateProcesses();
- for i, strPath in pairs(tblProcesses) do
- local strFile = String.SplitPath(strPath);
- if (String.Lower(strFile.Filename..strFile.Extension)) == strProcess then
- System.TerminateProcess(i);
- end
- end
- end
- -- An example
- System.EndProcess("itunes.exe")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement