Sign in to follow this  
Followers 0
PerryRaptor

Automated System Maintenance

6 posts in this topic

There isn't much to write about, no new concepts, tricks, or flashy GUI--This little script makes quick work of running Disk Clean Up, Disk Defragmenter, and SpybotSD sequentially.

You can remote in to a server or workstation and start this script and it will do all the hard work for you. Also, you could use schtasks.exe and schedule it to run.

ProgressOn("Automated System Maintenance", "running processes","0 percent", 555, 555)
$pbar = 10 
sleep(1000)
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Disk Clean Up")
RunWait("CleanMgr.exe /sagerun: 777", "C:\WINDOWS")
$pbar = 20
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Defragmenting Boot Files")
RunWait("Defrag c: -b", "C:\WINDOWS", @SW_HIDE )
$pbar = 30
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Defragmenting C:\ Drive")
RunWait("Defrag c: -f", "C:\WINDOWS", @SW_HIDE )
$pbar = 40
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Defragmenting D:\ Drive")
RunWait("Defrag d: -f", "C:\WINDOWS", @SW_HIDE )
$pbar = 60
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  SpyBot Search and Destroy")
RunWait("C:\Progra~1\Spybot~1\Spybotsd.exe /minimize /autoupdate /autoimmunize /onlyspyware /autocheck /autofix /autoclose")
$pbar = 100
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "---------- ASM Complete ------------")
Sleep(2250)
ProgressOff()

Note: the progress bar values were choosen based on the performance of a particular server and not the activity taking place.

Share this post


Link to post
Share on other sites



There isn't much to write about, no new concepts, tricks, or flashy GUI--This little script makes quick work of running Disk Clean Up, Disk Defragmenter, and SpybotSD sequentially.

You can remote in to a server or workstation and start this script and it will do all the hard work for you. Also, you could use schtasks.exe and schedule it to run.

ProgressOn("Automated System Maintenance", "running processes","0 percent", 555, 555)
$pbar = 10 
sleep(1000)
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Disk Clean Up")
RunWait("CleanMgr.exe /sagerun: 777", "C:\WINDOWS")
$pbar = 20
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Defragmenting Boot Files")
RunWait("Defrag c: -b", "C:\WINDOWS", @SW_HIDE )
$pbar = 30
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Defragmenting C:\ Drive")
RunWait("Defrag c: -f", "C:\WINDOWS", @SW_HIDE )
$pbar = 40
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  Defragmenting D:\ Drive")
RunWait("Defrag d: -f", "C:\WINDOWS", @SW_HIDE )
$pbar = 60
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "--> Process:  SpyBot Search and Destroy")
RunWait("C:\Progra~1\Spybot~1\Spybotsd.exe /minimize /autoupdate /autoimmunize /onlyspyware /autocheck /autofix /autoclose")
$pbar = 100
ProgressSet( $pbar, $pbar & " percent" & @CRLF & @CRLF & @tab & "---------- ASM Complete ------------")
Sleep(2250)
ProgressOff()

Note: the progress bar values were choosen based on the performance of a particular server and not the activity taking place.

must be made very better!

there are people (like me) that haven't even a c: partition.... or the windows folder is not named WINDOWS!

try using macros!


[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Share this post


Link to post
Share on other sites

well i dont think that was his concern since he was in a controlled server enviroment.. I'm sure you could could rewrite it with macros tho.....


Share this post


Link to post
Share on other sites

It is just a scrap. I agree that macros would make it more universal--I just wanted to share the way to bundle up all of your server maintenance programs into one script.

Share this post


Link to post
Share on other sites

Thanks Perry..

SDimple clean and ( people can change it how they like )

you actually motivated me and i will be posting my version of this...

i should have done months ago for my XPClean Menu

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Valuator,

Your welcome and I look forward to your code.

I spend most of my AutoIT time automating workstation and server maintenance, installing patches and security updates, and application installs. I've created a number of utility scripts that collectively take care of the entire domain. I would have never been able to achieve the results without AutoIT and PStools.

Share this post


Link to post
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
Sign in to follow this  
Followers 0