Güncel Ams Process Yönetimi

Falcon

Yönetici
Kod:
process = "notepad.exe"

-- Başlat
Shell.Execute(process, "", "", "", SW_SHOWNORMAL, true)

-- Çalışıyor mu?
if System.DoesProcessExist(process) then
    Dialog.Message("Durum", process.." çalışıyor!", MB_OK, MB_ICONINFORMATION)
else
    Dialog.Message("Durum", process.." çalışmıyor!", MB_OK, MB_ICONSTOP)
end
 
dude,
since you're also the site administrator, you shouldn't post no sense scripts.

a) If you use the shell, you'll have problems both closing and returning messages.
b) System.DoesProcessExist() is not a valid command in AMS.
c) With this code, you won't receive any return messages.


Kod:
File.Run("notepad.exe", "", "", SW_SHOWNORMAL, false);

instances = 0;
filecheck = "notepad.exe"; 
processes = System.EnumerateProcesses();
for j, file_path in pairs(processes) do
    file = String.SplitPath(file_path);
    if (file.Filename..file.Extension) == filecheck then
    Dialog.Message("", "  Process  Running  ", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Application.ExitScript();
end
end
if (file.Filename..file.Extension) ~= filecheck then
    Dialog.Message("", "  Process  Not  Running  ", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
    Application.ExitScript();
    end
 
Geri
Üst