File.Run(_SourceFolder .. "\\usr\\local\\mysql\\bin\\mysqladmin.exe", "--user=root --password=root shutdown", "", SW_MINIMIZE, true); index_html = ""; if Folder.DoesExist("w:\\www\\xoops2\\templates_c\\") then File.Delete("w:\\www\\xoops2\\templates_c\\*.*"); TextFile.WriteFromString("w:\\www\\xoops2\\templates_c\\index.html", index_html, false); else -- end if Folder.DoesExist("w:\\www\\xoops2\\cache\\") then File.Delete("w:\\www\\xoops2\\cache\\*.*"); TextFile.WriteFromString("w:\\www\\xoops2\\cache\\index.html", index_html, false); else -- end if Folder.DoesExist("w:\\tmp\\") then File.Delete("w:\\tmp\\*.*"); TextFile.WriteFromString("w:\\tmp\\index.html", index_html, false); else -- end if Folder.DoesExist("w:\\recycler\\") then File.Delete("w:\\recycler\\*.*"); TextFile.WriteFromString("w:\\recycler\\index.html", index_html, false); else -- end Application.Sleep(1000); -- *********************************************************************** -- Name: FemmeFatalle -- Purpose: Terminates a system process based on a filename passed -- Values: sProcess: the process (e.g. apache.exe) to search for -- Returns: True if the process exists and was terminated, false if either -- the process wasn't terminated, or no process matched requested. -- *********************************************************************** function FemmeFatalle(sProcess) -- ****( DECLARE LOCAL VARIABLES )**** local tProcesses = {}; local tSplitPath = {}; local sFilename = ""; local bReturn = false; -- ****( GET TABLE OF ALL SYSTEM PROCESSES )**** tProcesses = System.EnumerateProcesses(false); -- ****( TRAVERSE THE PROCESS TABLE )**** for nHandle, sProcessPath in tProcesses do -- ****( SPLIT THE CURRENT PATH, GET JUST FILENAME AND EXTENSION )**** tSplitPath = String.SplitPath(sProcessPath); sFilename = tSplitPath.Filename .. tSplitPath.Extension; -- ****( IF THE CURRENT FILENAME/EXTENSION MATCHES PASSED )**** if String.CompareNoCase(sFilename, sProcess) == 0 then -- ****( PROCESSES MATCH, TERMINATE IT )**** System.TerminateProcess(nHandle); -- ****( GET THE LAST ERROR AND SET RETURN VALUE )**** err = Application.GetLastError(); if (err == 0) then bReturn = true; else bReturn = false; end end end -- ****( RETURN TRUE/FALSE )**** return bReturn end FemmeFatalle("mysqld-opt.exe"); FemmeFatalle("apache.exe"); FemmeFatalle("mysqld-opt.exe"); FemmeFatalle("apache.exe"); FemmeFatalle("mysqld-opt.exe"); FemmeFatalle("apache.exe"); FemmeFatalle("mysqld-opt.exe"); FemmeFatalle("apache.exe"); File.Run("subst.exe", "/d w:", "", SW_MINIMIZE, true); --[[ bMorte = FemmeFatalle("apache.exe"); if bMorte then -- Dialog.Message("Result", "Process was terminated"); else -- Dialog.Message("Result", "apache.exe was NOT terminated"); end bMorte = FemmeFatalle("mysqld-opt.exe"); if bMorte then -- Dialog.Message("Result", "Process was terminated"); else -- Dialog.Message("Result", "mysqld-opt.exe was NOT terminated"); end ]]--