Defrag Tool!

chaos945

OSNN Senior Addict
Joined
10 Feb 2003
Messages
934
I was fooling around today and decided I needed to make an application that had a progress bar. So after fiddling with a few ideas I started to make a new defrag tool to replace my aging batch files.

I came up with this simple tool that detects all FIXED drives then uses the windows defragmenter to defragment them, with a progress bar of course. After the tool is finished defragmenting it then utilizes the 'ProcessIdleTasks' command, which then re-arranges files on the disk to match the exact order they are loaded during startup. This list is in %systemroot%\Prefetch\Layout.ini.

Anyone get errors please post them.

Enjoy!

/Revision
I've added the actual progress values rounded to the nearest whole number as they go by.

*see latest post for new version*
 
that looks pretty good chaos.

I'm using an after market defrag, but I can't wiat to see what people that try this think
 
I am trying it out right now for ya, I will update this post with my results.

Update: Well, the progress bar really didn't do much other than show a percentage of the process as a whole. It stayed at 0% till it was done with C:, then jumped to 58% when it worked on D:, so on and so forth. Not bad if that was what you intended it to do. I use DK and it runs nightly so my system never really gets fraged.

ohhh the only slightly annyoing part was that you can't minimize the status bar to your tray (IE like when your DL'ing something you can see the percentage in the taskbar as it is DL'ing.), having it on top while trying to do other things just a bit of a pain.

But overall, very nice.
 
Thanks for trying it out!

I modified the MsgBox so that it does not stay on top.

The progress bar determines the overall percentage based on the number of drives you have on the computer, I'm working on a new formula for it so it takes the size of each drive, the total number of drives, then based on the average time it takes to defragment x.x mb of space determine a new percentage.

This is the only way I could think of doing it, anyone with other ideas please post them.

Code:
Old Formula
( ( $i - 1 ) * 100 ) / $var[0]
$i current drive
$var[0] total number of drives
$1 - 1 because the progress needs to start at 0% not at the finished % of the current drive

I ended up with this nifty Drive Info tool while testing out how to make the new forumla. This tool finds the free/total/label/type of drives on your computer and displays it all.
  • Esc to Exit
  • Page Down for next drive
  • Page Up to go back
Anyone with some good ideas on what to add to the Drive Info tool?


Enjoy!

*link removed: see below*
Download Part 1
Download Part 2
 
Last edited:
I will test the new bar for ya, and will update this post

oooops, I need to learn to read post a little more carefully, you said you are "working on" a new formula, sorry I am just illiterate..................
 
Well I modified the way the progress bar works; it is more accurate now and will determine progress based on drive sizes instead of the number of drives.

I tried to get it to sub-calculate values for each drive based on the time it takes to defrag x.x MB and the total size of the drive but it was more difficult than I expected, perhaps later I will add an Estimated Time Remaining: counter as well.

*link removed: see below*
Download Part 1
Download Part 2
 
Last edited:
Any way of getting to choose which drives to defrag?

And the same with drive info? Also what about a different colour other than white in the bar?
 
I could make it so that either program gets its config info from an INI file, this would allow customization.

The colours are based on the system's current style/theme setup, mine is blue. I'm sure its possible to force a colour or allow something like a hex change via an INI file, I'll look into it and post back if I'm able to do it. I'm using AutoIt as a scripting language so its pretty limited unless its ported out.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back