Jump to content

Recommended Posts

Posted

I have always been annoyed by the fact that Power users cannot defrag there own computers. We did not have it in our budget to purchase a defrag solution for our users either. I looked into so many different tricks that would allow the users to defrag there own hard drive or for us to schedule defrags on there hard drives and in the end none of them would work. With Autoit I created a way for a power user to defrag there own hard drive. Basically it is a combination of autoit installed, the Morpheus defrag utility, and repackaged into a MSI file. When it deploys VIA group policy it puts a icon in there start menu. When they run it defrag automatically analyzes and defrags the hard drive. For this to work we have the same local administrator password on all machines, since auto IT is actually temp using the local admin password to run defrag.


Posted

@shareef59

I hope this doesn't sound like I'm avoiding your request for help, but my best advice is to spend a good bit of time with the AutoIt Help File, particularly the Script Commands section. The help file is the only comprehensive tutorial available, as far as I know.

You'll also find excellent solutions to nettlesome problems like the one cerw1n described by searching Google. Some pretty talented IT people use this little proggy for odds and ends jobs.

In my case, I copy a compiled AutoIt script to the Administrator's startup folder during the Windows Update process, when I'm fiddling with other shortcuts changes, etc. At startup following reboot, the configuration file launches after a 10 second delay (user input is blocked during this period) and the tweaking begins. For example:

IfWinExist, PsShutdown, The system is shutting down, Goto, Quitnow

BlockInput, on

Sleep, 10000

BlockInput, off

MsgBox, 36, Attention!, Configure this PC?

IfMsgBox, YES, Goto, next1

IfMsgBox, NO, Goto, next2

next1:

SplashTextOn, 290, 110, Installation in Progress, Configuring the Task Bar and Start Menu...

Sleep, 2000

SplashTextOff

RightClick, 600, 750

Sleep, 300

Send, r

WinWaitActive, Taskbar and Start Menu Properties

Send, !h

Sleep, 500

Send, {TAB}

Sleep, 500

Send, {ENTER}

SplashTextOn, 290, 110, Installation in Progress, Configuring TweakUI Powertoy...

Sleep, 2000

SplashTextOff

;adjust TweakUI

Run, tweakui

WinWaitActive, Tweak UI, Tweak UI for Windows

Sleep, 1000

Send, {DOWN}

Sleep, 500

;General settings

Send, {TAB}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN 2}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {DOWN}

Sleep, 500

;Explorer settings

Send, {TAB}

Sleep, 500

Send, {DOWN 6}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {RIGHT}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, !N

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {UP}

Sleep, 500

Send, {LEFT}

Sleep, 500

Send, {DOWN}

Sleep, 500

;Common Dialogs settings

Send, {TAB}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {DOWN}

Sleep, 500

;Desktop settings

Send, {TAB}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {DOWN}

Sleep, 500

;My Computer settings

Send, {TAB}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {DOWN}

Sleep, 500

;Control Panel settings

Send, {DOWN}

Sleep, 500

;Templates settings

Send, {DOWN}

Sleep, 500

;Internet Explorer settings

Send, {TAB}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB 4}

Sleep, 500

Send, {DOWN}

Sleep, 500

;Command Prompt settings

Send, {DOWN}

Sleep, 500

;Logon settings

Send, {TAB}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {DOWN}

Sleep, 500

Send, {SPACE}

Sleep, 500

Send, {TAB}

Sleep, 500

Send, {ENTER}

WinClose, Tweak UI

....

That's where I better end, unless someone says it's OK to post 476 lines!

My IT pals chuckle when they see me working with this, but they're always peeking over my shoulder with interest. And again, the process described above goes on to complete a few operations that, well, I wouldn't know how to begin to accomplish using any other method. For example, how would you give a user the option to install Intellipoint post-unattended? I ask point-blank whether they want to install it, and if the answer is affirmative, another script runs and installs it, cleaning everything up afterward. This is not something that a non-programmer newbie (like me) is going to tackle on a weekend but it's worth a close look. Check it out. :)

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
  • Recently Browsing   0 members

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