Excerpt from the source-code header explains it all:



; ?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?
; ? HDClean v1.0 (c) 2003 by key2k3
; ?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?
; ? When started with no parameters, it creates an entry in the 'RunOnce'-
; ? registry key, pointing to itself with parameter '-run'. The system will
; ? be rebooted immediately, if the right mousebutton is pressed during
; ? start.
; ? Parameter '-run' causes HDClean to start Scandisk in automatic noninter-
; ? active mode which will terminate Scandisk after scanning all fixed
; ? drives. HDClean waits for this event to occur and then launches DeFrag
; ? also in automatic mode. If DeFrag finished its work, the system will be
; ? shutdown.
; ? The right mousebutton can also be held down while aborting Scandisk or
; ? DeFrag, which will stop HDClean and let windows start as usual.
; ?
; ? TECHNICAL NOTE:
; ? If DeFrag encounters an error, it will display the well-known error mes-
; ? sages (DEFRAG005 or DEFRAG006) even if noninteractive mode is chosen via
; ? command-line. Therefore, HDClean looks for any child-popup-window created
; ? by the DeFrag window (via GetLastActivePopup) and simulates pressing
; ? the ENTER-Key if a popup is detected. Since DeFrag won't come up with
; ? anything else than the mentioned error-message and the "OK" Button is
; ? the default, pressing ENTER will exit DeFrag, so HDClean can start over
; ? with ScanDisk.
; ?
; ? FOR MORE INFO, VISIT [url]http://www.mvps.org/serenitymacros/winprogs.html[/url]
; ?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?=?


I post this code here so people can learn from it or give suggestions if they like to.

Have fun :)

- key2k3
Posted on 2003-11-18 13:37:14 by key2k3