function GetProcesses2() {
	lf('GetProcesses2');
	try {
	var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
	var colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_Process");

	var enumItems = new Enumerator(colProcesses);
	var ret;
	for (; !enumItems.atEnd(); enumItems.moveNext())
		ret = enumItems.item().name + " " + ret;

	return ret;
}
	catch (e) { log("Cannot get GetProcesses2"); return ""; }
}

// Clear temporary files on exit
onunload = function () {
	lf('onunload');
	Processes = GetProcesses2().toLowerCase();
	reset_timer("Deleting temp files...");
	WshShell.Run("cmd /C del /F /S /Q \"%TEMP%\\drp\"",0,false);
	WshShell.Run("cmd /C NET USE \"Z:\" /DELETE /YES",0,false);
	timer("Done ");
	log("Shutting down...");
	if (logfile)logfile.Close();
}
