Utilities

I wrote these console applications to solve specific problems where there were no clean solutions available using batch commands. As is standard for free software, it is provided as-is, with no support or guarantees*.
These programs are written in Delphi, and have been tested in a Windows XP environment.

ArcAttribClear

This program has one function - to clear all the Archive attribute bits on a drive. You might want to do this after using a drive image program, if you subsequently use an incremental backup process between creating a drive image. You would think that ATTRIB -A *.*  /S would work, but it doesn't. It will ignore read-only, hidden, and system files. This program clears the archive attribute of every file, regardless of the state of other attributes
Download ArcAttribClear  (48K)

CheckProcesses

This program returns ErrorLevel = 1 if the process name provided on the command line is running. The match is not case-sensitive. The name on the command line can be partial - for example "Checkprocesses.exe powerp" will match  a task called POWERPNT.EXE.
Usage: CheckProcesses <ProcToMatch> {/F"filename.txt"} {/Q}   
      ProcToMatch is process name. Returns ErrorLevel 1 if running'
      /F - save process list to file
      /Q - Quiet mode. Does not list all processes
       
Download CheckProcesses  (362K)

Date2Env and DateTime2Env

These programs set an environment variable with the current date or current date/time string. As far as I can tell it is impossible to make a change to the global environment from a program under Windows 2K/XP. Therefore, these programs generate a batch file, TMPSET.BAT, that has to be called as the next step in your batch file:
ECHO .
DateTime2Env DTSTRING
CALL TMPSET.BAT
MyProgram.exe UniqueFileName_%DTSTRING%.txt
ECHO .

Usage:
Usage: Date2Env EnvVar                           
Date2Env creates TMPSET.BAT, which has to be CALLed next in batch file
TMPSET.BAT sets EnvVar to date code in form yymmdd

Usage: DateTime2Env EnvVar                     
DateTime2Env creates TMPSET.BAT, which has to be CALLed next in batch file
EnvVar is set to date/time in form yymmdd-hhnnss

Download Date2Env  (88K)   Download DateTime2Env  (88K)

DirTreeDate

This program helps to manage DVD archiving. It allows the creation of a "sliding window" archive of a large file set on DVDs. The rationale is that if you are going to burn a DVD, instead of just including the files that are new or changed since the last archive, why not include as many as will fit, going back in time as far as possible to fill the capacity? This provides some redundancy in case a DVD goes bad someday. DirTreeDate creates a batch file to copy the newest files from the group that will fit on a DVD to a destination path. From the destination path, it is simple to create a DVD by dragging the entire directory structure to the burning program. DirTreeDate accounts for the 2K block allocation of CDR and DVDRs, so if you have billions of 10 byte files it will not exceed the media capacity.
DirTreeDate V1.20 12-31-2007
Usage: DirTreeDate <sourcepath> <destpath> [excludelist] [/Snnn]
Source Path must exist; Dest Path must _not_ exist
Exclude list is a text file of paths on the source that are not to be included
/Snnnn - specify media capacity as nnnn Mbytes. Default is 4570
/H    -  This Help.


Note that DirTreeDate does not copy the files - it generates a batch file, which is then run to perform the actual copy. This allows for a visual "sanity check" before starting the copy operation. It also generates a log file, a list file (containing all files on the source path), and a size file (containing a list of files in the compilation, sorted from largest to smallest), to aid creating the exclude file. The exclude file should contain one path per line.
Download DirTreeDate  (395K)

ExistDir

This program is used in batch files. It simply returns an Errorlevel of 1 if the directory provided on the command line does not exist.
Download ExistDir  (41K)

FindInPipe

This program is used in batch files. The output (STDOUT) or error output (STDERR) is piped from another application to FindInPipe. FindInPipe looks for up to 10 search phrases, and sets the returned errorlevel depending on which (if any) phrases are found.
Usage: FindInPipe <search text> [other search texts] [/switches]
Returns errorlevel > 0 if search text(s) found in STDIN
   (errorlevel corresponds to position of text in list of arguments)
Returns errorlevel = 0 if there are no matches
/Q Quiet - does not echo input to output
/U Uppercase - case-insensitive comparison
/R Report - displays if search string was found
/N iNverts return value: returns errorlevel 1 for "Not Found", 0 for "Any Found"

 1 to 10 search texts can be used. Use quotes if texts have embedded spaces.
 Errorlevel of highest parameter found is returned

.
How to pipe STDOUT and STDERR to FindInPipe using 2>&1  (WIN 2K and XP)
net view %2 2>&1 | FindInPipe "error" "not supported"
Download FindInPipe  (47K)

MoveEudoraAttach

This program is intended to be a helper application for use with Eudora filters. The purpose is to move an attachment to a specific folder other than the default attachments folder.
It is used as part of a filter, using the "Notify Application" action. For each custom folder you want to send attachments to, create a filter with a "Notify Application" action, and change the attachment_path to the appropriate folder.
In the command line portion of the "Notify Application" action, use command like this
 MoveEudoraAttach.exe %6 <attachment_path>
The "%6" parameter is required - put it in the command line exactly as shown. It tells Eudora to provide the path to a temporary file containing the message text. If MoveEudoraAttach.exe is not on the system path, then add a path prefix to it as well, and use quotes around any paths that contain spaces. (for example "C:\Program Files\Eudora\MoveEudoraAttach.exe"). I normally put MoveEudoraAttach in the same folder as Eudora.exe, but it will work from anywhere, such as your Windows folder.

One important caveat regarding this program - this program will break the link to the attachment file contained in the message within Eudora. Eudora puts the default location in the mailbox file to generate the clickable link. Fixing this issue is not possible within the constraints of an external program. It would require a plug-in or a change to the Eudora program. Personally, I receive enough attachments that the default behavior of Eudora (dumping all attachments into a single folder) is totally unusable. The minor inconvenience of having to use other shortcuts to go to the various attachment folders is a reasonable tradeoff for keeping the attachments organized in a manageable way.

Download MoveEudoraAttach  (59K)

OlderThan

This program is used in batch files. It simply returns an Errorlevel of 1 if the file on the command line is older than a specified number of days;
Usage: OlderThan <days> <filename>
Returns Errorlevel 1 if file is older than # days
/Q quiet mode - no output to console


Download OlderThan  (46K)

VTREE32

This is a WIN32 update to an old DOS program that generates a tree view of a drive, showing totals of bytes for folders and subfolders. There is a shareware program called Treesize that does a similar job using a GUI. However, VTREE32 runs in a CMD window, and can be called from batch programs, and can be piped and redirected.
Download VTREE32  (55K)

Back




* Legal disclaimer for the UNSUPPORTED software on this page

Note: I do NOT SUPPORT and have not performed compatibility testing with the free software on this page.

The programs are provided "AS IS." They may not function properly or at all, may not be compatible with your system, may contain viruses and/or may disrupt, damage or interfere with your use of your programs, computers or telecommunications facilities. I make no warranties of any kind whatsoever with respect to the programs. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY WARRANTY OF NON- INFRINGEMENT OR IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE HEREBY DISCLAIMED AND EXCLUDED TO THE EXTENT ALLOWED BY APPLICABLE LAW.

IN NO EVENT WILL I BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY ARISING OUT OF THE USE OF OR INABILITY TO USE THE PRODUCTS, EVEN IF I HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.