Jump to content

MaXoFF - A Simple Daily ShutDown Optimizer


Valuater
 Share

Recommended Posts

MaXoFF - v1.3.0.+ - 9/26/2010

Made on Xp Home sp3

Tested OK on Vista

No Includes

100% Autiot

Ran by Tray Icon

USE DAILY TO SHUTDOWN... and let it work!

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\..\..\Documents and Settings\Administrator\My Documents\My Pictures\RENSIM Icon.ico
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Description=RENSIMs MaXoFF - Shutdown Optimizer
#AutoIt3Wrapper_Res_Fileversion=1.3.0.11
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

;MaXoFF by Valuater 9/25/2010 v1.3.0
;http://www.microsoft.com/atwork/getstarted/speed.mspx

Global $PID, $StartUp, $Count = 0, $Runner = False, $Drive = @HomeDrive & "\"
Global $percent = 100 / 12, $wait = 3500, $min = WinMinimizeAll()
Global $MaXHide, $sTime, $User = FileGetLongName(StringTrimRight(@TempDir, 5))
Global $User2 = StringTrimRight($User, 15)
Global $Typical_exe = "lsass.exe,csrss.exe,services.exe,winlogon.exe,svchost.exe,ctfmon.exe,smss.exe"

Opt("GUIOnEventMode", 1)
Opt("GUICloseOnESC", 1)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

If UBound(ProcessList(@ScriptName)) > 2 Then
    MsgBox(64, "* NOTE * ", "RENSIM's MaXoFF -  was already running  ", 5)
    Exit
EndIf

$run_tray = TrayCreateItem("Run MaXoFF")
TrayItemSetOnEvent(-1, "Set_Run")
TrayCreateItem("")
$startup_tray = TrayCreateItem("Run @StartUp = " & $StartUp)
TrayItemSetOnEvent(-1, "Set_StartUp")
TrayCreateItem("")
$about_tray = TrayCreateItem("About RENSIM's MaXoFF")
TrayItemSetOnEvent(-1, "Set_About")
TrayCreateItem("")
$exit_tray = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "OnAutoItExit")
TraySetState()
TraySetToolTip("RENSIM's MaXoFF - ShutDown Optimizer")

Set_StartUp()

While 1
    Sleep(100)
    If $Runner Then
        ProcessSetPriority(@ScriptName, 4)
        ProgressOn("RENSIM's MaXoFF - Main Window", "A Simple Daily ShutDown Optimizer", "Overall Program Completion...   ", 20, 20, 16)
        MsgBox(262192, "MaXoFF - Start-Up Initiated", "MaXoFF will automatically start in 10 seconds!     " & _
                @CRLF & @CRLF & "** PLEASE CLOSE ALL PROGRAMS **      ", 10)
        Prog_Set(1, "", "Initializing... Hard Drive Information")
        Local $Drive_Start = Get_Free()
        Prog_Set(1, "", "Creating... Restore Point")
        Local $sr = ObjGet("winmgmts:\\.\root\default:Systemrestore")
        $sr.createrestorepoint("RENSIM's MaXoFF - Restore Point", 0, 100)
        Prog_Set(1, "", "Scanning... Malware Process")
        _CheckMalwareProcess()
        Prog_Set(1, @ComSpec & " /c del /s /q " & @TempDir & "\*.*", "Cleaning... Temporary Files")
        Prog_Set(1, @ComSpec & ' /c del /s /q "' & $User2 & '\Recent\*.*"', "Cleaning... Traces Folder")
        Prog_Set(1, "", "Scanning... Privacy Sweep")
        _Check_PrivacySweep()
        Prog_Set(1, @ComSpec & " /c del /s /q " & $User & "\History\*.*", "Cleaning... History Folder")
        Prog_Set(1, @ComSpec & ' /c del /s /q "' & $User & '\Temporary Internet Files\*.*"', "Cleaning... Temporary Internet Files")
        Prog_Set("", @SystemDir & "\Cleanmgr.exe  /Sagerun:99", "Running... Extended Clean Manager")
        Prog_Set(1, @SystemDir & '\Defrag.exe ' & $Drive & ' -b', "Running... Defragment Boot Files")
        Prog_Set(1, @SystemDir & '\Defrag.exe ' & $Drive, "Running... Defragment " & $Drive & " Drive")
        Prog_Set(1, "", "Finalizing... Files Removed")
        $Drive_End = Get_Free()
        $Cleaned = $Drive_End - $Drive_Start
        $FCleaned = Round($Cleaned / 1024 / 1024, 2)
        FileWrite("MaXoFF_File_Report.log", "MaXoFF Removed " & $FCleaned & " MB of Trash    " & @CRLF & @CRLF)
        ProgressSet(100, "... Shutting System Down ", "MaXoFF Removed " & $FCleaned & " MB of Trash    ")
        If MsgBox(262192, "MaXoFF - ShutDown Initiated", "MaXoFF will automatically shutdown in 30 seconds!   " & _
                @CRLF & @CRLF & "Press *OK* to Cancel.", 30) = -1 Then Shutdown(9)
        ProgressOff()
        $Runner = False
        ProcessSetPriority(@ScriptName, 2)
    EndIf
WEnd

Func _CheckMalwareProcess() ; "http://pcpitstop.com/libraries/process/topmalicous"
    $URL = "http://pcpitstop.com/libraries/process/topmalicous"
    Local $rList = "", $Foo_txt = @ScriptDir & "\foo.txt", $foo = InetGet($URL, $Foo_txt)
    If $foo = 0 Then Return -1
    $aRecords = StringSplit(FileRead($Foo_txt), @CRLF, 1)
    FileDelete($Foo_txt)
    For $x = 1 To $aRecords[0]
        If StringInStr($aRecords[$x], ".exe") Then
            $s_Start = StringInStr($aRecords[$x], "/i/") + StringLen("/i/")
            $Final = StringMid($aRecords[$x], $s_Start, StringInStr($aRecords[$x], '.html">') - $s_Start)
            If StringRight($Final, 4) = ".exe" And ProcessExists($Final) Then
                If Not StringInStr($Typical_exe, $Final) Then
                    $Info = _PidGetPath($Final)
                    $rList &= "Process = " & $Final & @CRLF & "Location = " & $Info & @CRLF & @CRLF
                    ConsoleWrite("Process = " & $Final & @CRLF & "Location = " & $Info & @CRLF & @CRLF)
                EndIf
            EndIf
        EndIf
    Next
    If (FileGetSize("error.log") / 1024) >= 20 Then FileDelete("error.log")
    If $rList = "" Then $rList = "No Malicious exe files were found."
    Return FileWrite("MaXoFF_File_Report.log", @MON & "-" & @MDAY & "-" & @YEAR & @CRLF & "If you have a problem see " & $URL & @CRLF & $rList & @CRLF)
EndFunc   ;==>_CheckMalwareProcess

Func _Check_PrivacySweep()
    If DirGetSize($User2 & "\Cookie Keeper\") = -1 Then
        FileCopy($User2 & "\Cookies\*.txt", $User2 & "\Cookie Keeper\", 9)
        ShellExecute($User2 & "\Cookie Keeper\")
        MsgBox(4096, "MaXoFF - Cookie Keeper", "Please remove all unwanted cookies from this list. ( First Run Only)      " & @CRLF & _
                'MaXoff will Automatically Delete all Cookies except this "Do Not Remove List"' & _
                @CRLF & "In the Future, You can Manage this list Add/Remove Cookies. Go to...  " & @CRLF & $User2 & "\Cookie Keeper\")
    EndIf
    RunWait(@ComSpec & ' /c del /s /q "' & $User2 & '\Cookies\*.*"', "", @SW_HIDE)
    Return FileCopy($User2 & "\Cookie Keeper\*.txt", $User2 & "\Cookies\")
EndFunc   ;==>_Check_PrivacySweep

Func Set_StartUp()
    $StartUp = Not $StartUp
    TrayItemSetText($startup_tray, "Run @StartUp = " & $StartUp)
    If $StartUp And @Compiled = 1 Then
        FileCreateShortcut(@ScriptDir & "\" & @ScriptName, @StartupCommonDir & "\" & @ScriptName & ".lnk", @ScriptDir, "", "This is a Simple Daily ShutDown Optimizer link 8)", "", "", "", @SW_SHOWNORMAL)
    Else
        If FileExists(@StartupCommonDir & "\" & @ScriptName & ".lnk") Then FileDelete(@StartupCommonDir & "\" & @ScriptName & ".lnk")
    EndIf
    Return 1
EndFunc   ;==>Set_StartUp

Func _PidGetPath($sProc = @ScriptFullPath)
    $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE ProcessId = " & ProcessExists($sProc), "WQL", 0x10 + 0x20)
    If IsObj($colItems) Then
        For $objItem In $colItems
            If $objItem.ExecutablePath Then Return $objItem.ExecutablePath
        Next
    EndIf
    Return -1
EndFunc   ;==>_PidGetPath

Func Prog_Set($display, $program, $ptext, $flag = @SW_HIDE)
    $Count += 1
    ProgressSet($Count * $percent)
    ConsoleWrite($program & @CRLF)
    Sleep($wait / 2)
    If $display Then Run_Progess($ptext)
    Sleep($wait / 2)
    If $program <> "" Then $PID = RunWait($program, "", $flag)
    Sleep($wait)
    Return GUIDelete($MaXHide)
EndFunc   ;==>Prog_Set

Func Set_About()
    ; Press Retry for Registry Restore
    If MsgBox(262213, "RENSIM's MaXoFF     ver " & FileGetVersion(@ScriptName), "USE DAILY TO SHUTDOWN" & @CRLF & @CRLF & _
            "This simple system will quickly speed up your computer      " & _
            @CRLF & @CRLF & "    Thanks   Valuater... 8)" & @CRLF & @CRLF & "Retry = Run System Restore", 15) = 4 Then _Restore_Registry()
    Return 1
EndFunc   ;==>Set_About

Func Set_Run()
    $Runner = True
    Return 1
EndFunc   ;==>Set_Run

Func OnAutoItExit()
    ProcessClose($PID)
    Exit 0
EndFunc   ;==>OnAutoItExit

Func Get_Free()
    $fso = ObjCreate("Scripting.FileSystemObject")
    $d = $fso.GetDrive(@HomeDrive)
    $Free = $d.FreeSpace
    $fso = ""
    Return $Free
EndFunc   ;==>Get_Free

Func Run_Progess($Text = "")
    $MaXHide = GUICreate("MaXoFF HiDDeN")
    GUISetState(@SW_HIDE, $MaXHide)
    $Location = "Progress.au3"
    FileDelete($Location)
    $program = '#NoTrayIcon' & @CRLF _
             & 'Global $Test = True' & @CRLF _
             & 'ProgressOn("RENSIMs MaXoFF - Process Window", "' & $Text & '", "Working... ")' & @CRLF _
             & 'Local $Percent = 100 / 20, $loop = 0' & @CRLF _
             & 'While WinExists("MaXoFF HiDDeN")' & @CRLF _
             & '    If $Test And ProcessExists("Defrag.exe") Then' & @CRLF _
             & '        ProcessSetPriority ("Defrag.exe", 4)' & @CRLF _
             & '        ProcessSetPriority ("dfrgntfs.exe", 4)' & @CRLF _
             & '        $Test = False' & @CRLF _
             & '    EndIf' & @CRLF _
             & '    $loop += 1' & @CRLF _
             & '    ProgressSet($Percent * $loop)' & @CRLF _
             & '    If $Percent * $loop >= 100 Then $loop = 0' & @CRLF _
             & '    Sleep(700)' & @CRLF _
             & 'WEnd'
    FileWrite($Location, $program)
    If @Compiled = 1 Then
        $file_exe = FileGetShortName(@AutoItExe & ' /AutoIt3ExecuteScript "' & $Location & '"')
        Return Run($file_exe)
    Else
        $file_au3 = FileGetShortName($Location)
        Return Run(@AutoItExe & " " & $file_au3, "", @SW_HIDE)
    EndIf
EndFunc   ;==>Run_Progess

Func _Restore_Registry()
    $Shell = @SystemDir & "\restore\rstrui.exe"
    ShellExecute($Shell)
    Return 1
EndFunc   ;==>_Restore_Registry

Enjoy!!!

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

@Valuater

Seems to be nice but Exit code: 0 Time: 2.486 without anything...

Cheers, FireFox.

nO eRROS... THATS GREAT... LOL

I just copied it from above and it ran fine!

is that 2.4 seconds... geese

you on windows xp?

because all the the clean and defrag stuff calls window products

I sure would like to have someone help me with vista testing

8)

NEWHeader1.png

Link to comment
Share on other sites

right now, im running it on vista. but since i have a lot of stuff and crap on my computer, its going to take a while... so far its still on the clean manager.

i like the script.

is there a way, maybe you could add like an ETA, and i would love the delete button on the registry gui.

good job.

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

right now, im running it on vista. but since i have a lot of stuff and crap on my computer, its going to take a while... so far its still on the clean manager.

i like the script.

is there a way, maybe you could add like an ETA, and i would love the delete button on the registry gui.

good job.

Thanks bill..!!

I really wish I could create an ETA, but I have no idea...

how slow then system is...

how much crap is on it

how bad the defragments are

how much space is on the hard drive

... etc, etc

I am working on the delete button, but want to improve the registry cleaner first

thanks again

8)

EDIT, Please let me know how it works on your vista system, sounds good so far!! :)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

wow, it took about 10-15 minute, 'cause of all the stuff.

one thing, i dont know if it was your program, but when i started up again. my theme service was turned off, and i had to restart it. not sure if thats you or me, but other than that, i definitely see improvement. runs at a noticeably faster speed.

Thanks. will be using this a lot.

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

I like the script, but it blew out my video driver for some reason. I am working on 4 bit driver till I fix, just thought I would post this result.

edit: Back in the game now, reinstalled drivers and rebooted a couple times and good as new. Did seem to speed up my pc nicely! Thanks Valuater!

Edited by gseller
Link to comment
Share on other sites

I like the script, but it blew out my video driver for some reason. I am working on 4 bit driver till I fix, just thought I would post this result.

edit: Back in the game now, reinstalled drivers and rebooted a couple times and good as new. Did seem to speed up my pc nicely! Thanks Valuater!

@gseller

I am sure glad you were able to get the video driver going, however this should not effect that.

@billthecreator

Great, so this operates on vista with no problems.... :)

It will be quicker the next time, also whats great about this is... you just walk away and it will do the rest

8)

NEWHeader1.png

Link to comment
Share on other sites

Yea. Its great.

I think it would look nice, instead of the true/ false for the tray items, just having checks.

If i added that myself, would i need the constants include?

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

Yea. Its great.

I think it would look nice, instead of the true/ false for the tray items, just having checks.

If i added that myself, would i need the constants include?

Nice Idea, I am sure the includes can be avoided for the checkboxes.

I would like to use Icons, but I am sure that will require includes.

8)

NEWHeader1.png

Link to comment
Share on other sites

OK... Updated to ver 1.1.0

Got away from reaching into Peoples registry to remove stuff, I had a few "questionable" things happen by the above post for just cleaning ... use Space Regain for that ( it's pretty good, really! )

I added a progress bar for each action so if your system takes a while, you wont think it's not working

So, back to basics, Simple and Easy to Use!!

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

G'day Valuater

Just tried to test the script and I thought it had locked up.

I clicked run then nothing appeared to happen.

When I did a little fault finding it's not really a problem just the

$Drive_Start = Round(DirGetSize(@HomeDrive) / 1024 / 1024, 2)

It takes FOREVER to run and there is no indication that anything is happening.

Might be worth adding a progress bar to indicate that something is going on.

Other than that it looks great

John Morrison

Link to comment
Share on other sites

G'day Valuater

Just tried to test the script and I thought it had locked up.

I clicked run then nothing appeared to happen.

When I did a little fault finding it's not really a problem just the

$Drive_Start = Round(DirGetSize(@HomeDrive) / 1024 / 1024, 2)

It takes FOREVER to run and there is no indication that anything is happening.

Might be worth adding a progress bar to indicate that something is going on.

Other than that it looks great

John Morrison

Thanks for the feed-back John, I will take a look at that.

Overall has it helped you?

8)

NEWHeader1.png

Link to comment
Share on other sites

Hope you didn't change because of me Valuater? What happened to my machine is inconclusive. I am yet to not learn something or find useful any of your scripts.

No.. lol, not at all...

I looked into Space Regain and saw how much work MrBond put into that.. kinda like some stuff I have done.

So, I suggest his script for "deep" cleaning and mine for "daily" use. BUT, for most people my script will clean lots of crap on the first few runs and continually re-organize the files for a faster system.... ALL WITH ONE SIMPLE CLICK!

Space Regain only makes the "holes" in the info, mine cleans and consolidates in a optimized way.

did I say all that... lol

8)

NEWHeader1.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...