Jump to content

PaPd3fr4g....


hgeras
 Share

Recommended Posts

I created this simple proggie for 3 reasons:

1)It's simple!

2)It has shut down function

3)It can automatically defrag selected drives

Nothing fancy,just handy.I use the microsoft's defrag.exe command line options and a simple GUI.

I'm waiting for your opinion and any code corrections,although I tested and found no bugs.

C ya

PS I recommend to run it in beta mode cos au3chk will output errors due to ,still,unsupported functions

EDIT:Due to some changes seek the file below....

Edited by hgeras
Link to comment
Share on other sites

Phew! That was close! Someone found it useful too! hehe

Thanx lyledg , i hope it works fine for you too....

<{POST_SNAPBACK}>

Nice Crisp and simple.

Perfect

GoodJob

Hardcopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

One small concern: is it safe to ProcessClose() something that could potentially be in the middle of defragmenting a directory?

I once had a bad experience with a power failure during a defragment and I turned my computer back on to find half of my Windows directory in the root of the drive.

Edited by LxP
Link to comment
Share on other sites

LxP:

I believe it was because of the power failure mostly. If you check the windows help file about the command line version of defrag.exe , you will see that it says that if you wish to terminate defragment just press Ctrl+C which is the same "abrupt" as the ProcessClose() i use . I did it on my disks over 50 times to see that everything works ok and had no problem at all. But now that you mention that, maybe i will disable the stop function since my proggie will be used only for "midnight sessions" and there won't be any interactions.

I'm waiting for feedback from someone that has better knowledge on the subject.

For now you can just comment out the Guictrlsetstate() functions that enable the stop button so as you wont be able to push it by accident ,if you are afraid. Maybe i'll try - if feasible- to send the Ctrl+C command to the dos box for more suitable abortion.

Thx for the observation.

Link to comment
Share on other sites

It is possible for programs to capture the ^C and take action before terminating, whereas with ProcessClose() this kind of 'cleanup' is not possible.

The defragmenter may or may not act differently in these two cases but if it's at all possible to send ^C to the defragmenter then it definitely would be a much safer option than ProcessClose(). :whistle:

Link to comment
Share on other sites

I had to do this in a rather awckward and childish way but it's the only way that it will accept the ^C.... Check the updated source and press Stop and Quit without fear! It's weird though and maybe i'll post that to the bug section....

Edited by hgeras
Link to comment
Share on other sites

This is the final(i hope) and most suitably working version of the proggie...

I made some code corrections after LxP's observations and some code tweaking after herewasplato's suggestions....

Thanx for your input and have fun with the proggie(at last).

papdefrag_upd.au3

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