News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

DriveWait and DriveWait GUI

Started by Mark Jones, July 22, 2006, 07:15:41 AM

Previous topic - Next topic

Mark Jones

DW is a 32-bit Windows console-mode utility designed to wake up a removable drive, or if unresponsive, prompt to connect the drive. DWG is a GUI-equivalent with the added ability to execute the supplied arguments when the drive comes on-line. DWG will also operate from the command-line.

Why would anyone need this? Say you want to automatically backup some files to a USB hard disk every day before leaving the office. You can set a windows scheduled task to run a backup program like robocopy, but what happens if you forget to connect the drive? DW/DWG is a simple solution to this. Run DW first, and it will attempt to wake up the drive. If the drive does not respond in 16 seconds, a prompt is displayed asking to connect the drive. Or run DWG with the appropriate arguments to validate the drive and automatically launch the program of your choice. This gives you a chance to connect the device before the backup fails.

Usage: DW  [drive letter]
       DWG [drive letter] [program to run] [parameters...]

Example:
       DW P
       DWG H robocopy.exe /job:"C:\MyProg\Robocopy Job 3.rcj" /mir /copyall /it

DW & DWG require a drive letter to be specified. Only supply the letter itself, do not add the ":\" part or any path. Returned errorlevel = 0 for success and 1 for user cancel or failure to execute arguments.

Fully commented source code is included, complete with a makeit.bat and RadASM project files.


[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

GregL

Mark,

That's real handy.  :U  Thanks.