Jump to content

Automated System Maintenance


 Share

Recommended Posts

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.

Link to comment
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]

Link to comment
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.

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...