PDA

View Full Version : i need to stop a process but why the code not work?


lnd
04-01-2009, 05:39 AM
processes = System.EnumerateProcesses();

for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension)) == "Babylon.exe" then
System.TerminateProcess(j);
end
end

Stefan_M
04-01-2009, 07:21 AM
processes = System.EnumerateProcesses();

for j, file_path in processes do
file = String.SplitPath(file_path);
if (String.Lower(file.Filename..file.Extension)) == "babylon.exe" then
System.TerminateProcess(j);
end
end

if you use String.Lower() then your condition should have all lower case characters.