file_to_check_for = "wmplayer.exe"; --have all lowercase (todo en minusculas)
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
dResult = Dialog.Message("Terminate", "Want close Windows Media Player?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1)
if dResult == IDYES then
System.TerminateProcess(j);
end
end
end
tablaAlucard = {"uno.exe", "dos.exe", "tres.exe", "cuatro.exe", "cinco.exe"}
Sencillo...sarumanice escribió:O talves los puestos en un lixbox?
ListBox.DeleteItem("ListBox1", LB_ALLITEMS);
processes = System.EnumerateProcesses();
nCounter = 0;
for j, file_path in pairs(processes) do
nCounter = nCounter + 1;
sSplitProcs = String.SplitPath(file_path);
sProcName = sSplitProcs.Filename;
sProcExt = sSplitProcs.Extension;
sProcNameLow = String.Lower(sSplitProcs.Filename);
sProcExtLow = String.Lower(sSplitProcs.Extension);
sContainer = ListBox.AddItem("ListBox1", j.." "..sProcName..sProcExt, sProcNameLow..sProcExtLow);
Label.SetText("Label_Found", "Found: "..string.format("%02d", nCounter));
Application.Sleep(25);
end
nQuestion = Dialog.Message("Warning!", "You are about to end a process ...\r\n\r\nContinue?", MB_OKCANCEL, MB_ICONEXCLAMATION, MB_DEFBUTTON2);
if (nQuestion == IDCANCEL) then
Application.ExitScript();
else
sSelect = ListBox.GetSelected("ListBox1");
if (sSelect == nil) then
Application.ExitScript();
else
nFileToVeryf = ListBox.GetItemData("ListBox1", sSelect[1]);
instances_of_file = 0;
file_to_check_for = nFileToVeryf;
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
end
Page.ClickObject("xButton1");
end
cuenta = "1";
while true do
nFileToVeryf = ListBox.GetItemData("ListBox1", cuenta);
if nFileToVeryf ~= "" then
file_to_check_for = nFileToVeryf;
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
cuenta = cuenta + "1";
else
Dialog.Message("Notice", "Busqueda terminada!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
break;
end
end
if (String.Lower(file.Filename..file.Extension))
Analiza bien el ejemplo que te puse, este ejemplo es demasiado basico (propio de ams) y funciona perfectamente, al menos como yo te lo puse...sarumanice escribió:Pero me pregunto xq???
No es posible cerrar un proceso si el nombre esta en mayuscula?
eso rojo reemplazalo por el nombre del proceso a cerrar .TASKKILL /IM "HSSCP.exe" /F