Jump to content

Using autoit for more than Silent installs


 Share

Recommended Posts

Hi ive finished all the tweaks i want for my xpcd but one thing bothers me...when i first load it it needs defraggin.....ive tried using widows basic defragger but it just hangs so i got myself diskeeper 10 and wanted to know if someone could write or knows a script that would automatically set it to defrag the harddrive and then auto shut down the pc? Thanks in advance!!!

Link to comment
Share on other sites


I'm using Diskeeper2007 and do it this way:

1) Extract needed files to the Program Files directory using WinRAR with the following comment:

Path=Diskeeper Corporation\Diskeeper
SavePath
Setup=Install.exe
Silent=1
Overwrite=1

Install.exe is a compiled AutoIt script that runs after extraction:

TrayTip('Unattended Installation', 'Installing Diskkeeper 2007 Pro Premier . . . please wait . . .', 0, 1)
RunWait('msiexec /i "' & @ProgramFilesDir & '\Diskeeper Corporation\Diskeeper\DK2007.msi" /qn')
Sleep(500)
FileDelete(@ProgramFilesDir & '\Diskeeper Corporation\Diskeeper\DK2007.msi')
TrayTip("clear tip","",0)

TrayTip('Unattended Installation', 'Defragmenting the C: partition . . . please wait . . .', 0, 1)
RunWait ( @ComSpec & " /c Diskeeper C", "", @SW_HIDE )
TrayTip("clear tip","",0)

Nice. The Diskeeper2007 user manual has a brief section entitled "Running Diskeeper From the Command Prompt" spelling it out clearly. You can defragment multiple partitions by repeating the command and specifying different drive letters, no harm done if the drives are optical or do not exist. Lastly, you can shut down the machine by adding 'Shutdown(x)' to the end of the AutoIt script, where 'x' is any of several values. You're going to need to install AutoIt anyway to compile the script, might as well take a peek at the help file, eh? But 'Shutdown(1)' should work fine.

Edited by blinkdt
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...