Do you need a custom-built command line utility developed to your specifications?  Our prices are very reasonable, and automating part of your business is always worth a one time expense!  Inquire here.

Notes

• These programs run on all versions of Windows since XP.
• You may distribute these programs as long as they are not modified or sold.  If you would like to package them with a commercial program, please contact us.
• These programs do not have a graphical user interface.  They are meant to run from a command line (DOS prompt), batch file, or shortcut.  You should keep your command line programs in a folder on your hard drive, preferably one in the PATH.  We recommend "c:\windows\system32\".
• By the act of downloading and using these utilities, you must agree to the terms of the End-User License Agreement, which can be found here.  If you do not agree to the terms, you are not authorized to use our software.

Program Index

 BACKUP9.EXE - File Backup Utility
 COMBINE.EXE - File Combining Utility
 DELNEXT.EXE - Delete At Next Reboot Utility
 DELS.EXE - Recursive File Deletion Utility
 DIGSIG.EXE - Digital Signature Utility
 FCMP.EXE - File Comparison
 FIREWALL.EXE - Windows Firewall Configuration Utility
 GPATCH.EXE - File Patching Utility
 GS.EXE - Greg's DOS Shell
 NUMLINES.EXE - Source Code Line Counter
 PECHKSUM.EXE - Portable Executable Checksum Utility
 SIZEOF.EXE - File Size Reporting Utility
 SLEEP.EXE - Power Management Utility
 STARTAS.EXE - Executes a DOS command line under a different user account.
 TIMER.EXE - Timer Utility
 WOL.EXE - Wake On LAN

## BACKUP9.EXE

The BACKUP9.EXE utility will maintain a number of backups (9 by default) of a file.  For example, this command:

backup9.exe c:\baz\foo.bar

Will generate these backup files:

c:\baz\foo.bar.bk1
c:\baz\foo.bar.bk2
c:\baz\foo.bar.bk3
c:\baz\foo.bar.bk4
c:\baz\foo.bar.bk5
c:\baz\foo.bar.bk6
c:\baz\foo.bar.bk7
c:\baz\foo.bar.bk8
c:\baz\foo.bar.bk9

Where foo.bar.bk1 is the most recent backup, foo.bar.bk2 is the next most recent backup, et cetra.  Please note that this assumes that backup9 was called 9 times, and the original file changed each time.

Usage

backup9 [/a] [/e] [/i] [/l#] [/m] [/nologo] [/q] [/s] [/v] filespec [target]

Where filespec is a specification of the file(s) that should be backed up, and target is the path (drive and folder) where the backup files should be created.

Switches:
 /a Always perform backup, even if no change since last backup. /e Replace the source file's extension instead of appending. /i Ignore errors in the file specification. /l Number of backup levels, from 1 to 999 (defaults to 9). /m Maintain the folder structure.  This is only applicable with the /s switch and a target path. /nologo Suppress logo banner. /q Quiet mode - no banner or operation status. /s Recursively enter sub-folders. /v Verbose output (detailed information).

Notes

• The filespec can contain the wildcard characters, the asterisk (*) and the question mark (?).  It can also include multiple files separated by semi-colons.
• If the target folder does not already exist, it will be created.  If no target folder is specified, the backup files are created in the same folder as the source file.
• If either the filespec or target parameter contains spaces, it should be enclosed in quotes.
• No backup is made if the file has not changed since the last backup.
• If a file is locked, backup9 will retry up to 10 times over a one second period.  This is helpful for files that are sometimes briefly locked, like a database.
• Pressing the Escape key will interrupt the operation.

Example #1:  Specifying a Target Folder

backup9 /l3 c:\baz\foo.bar d:\target

Produces these backups:

d:\target\foo.bar.bk1
d:\target\foo.bar.bk2
d:\target\foo.bar.bk3

Example #2:  Wildcard, Long Path

backup9 /l3 "c:\baz\foo bar.*"

Might produce these backups:

c:\baz\foo bar.dat.bk1
c:\baz\foo bar.dat.bk2
c:\baz\foo bar.dat.bk3
c:\baz\foo bar.txt.bk1
c:\baz\foo bar.txt.bk2
c:\baz\foo bar.txt.bk3

Example #3:  Multiple Files

backup9 /l3 c:\baz\foo.dat;bar.txt

Produces these backups:

c:\baz\foo.dat.bk1
c:\baz\foo.dat.bk2
c:\baz\foo.dat.bk3
c:\baz\bar.txt.bk1
c:\baz\bar.txt.bk2
c:\baz\bar.txt.bk3

Example #4:  Replacing Extensions

backup9 /l3 /e c:\baz\foo.bar

Produces these backups:

c:\baz\foo.bk1
c:\baz\foo.bk2
c:\baz\foo.bk3

## COMBINE.EXE

COMBINE.EXE is a program that combines two or more files into a single file.

Usage

COMBINE [/a] [/fl] [/lb] [/nolist] [/nologo] [/nosum] [/s] target file1 file2 ...

Where target is the name of the new file to be created, and file1, file2, etc. are the "source files" containing the data that is to be combined into the new file.

Switches:
 /a Do not overwrite the existing contents of the target file.  Instead, append to the end of the target file. /fl The source file is a list of other source files.  It can contain one or more filepaths of source files, separated by line breaks or semi-colons.  This file can be ASCII, unicode, or UTF-8 (provided that the unicode or UTF-8 byte order mark is present). /lb Before a source file is added to the target file, a line-break will be added to the end of the target file if one is not already present. /nolist Do not list each file. /nologo Do not display the program banner. /nosum Do not display the operation summary. /s Recursively enter subfolders.

Notes

• The ? and * wildcard characters are permitted.
• If no path to the target file is specified, the target file is created in the current working directory.
• Any filename that contains spaces should be enclosed in quotes.
• You may press Escape to abort the operation.
• Filenames containing unicode characters are supported.

Example

combine foo.txt 1.txt 2.txt 3.txt

This creates a file in the current working directory named "foo.txt".  Its contents will be the combined contents of three files:  1.txt, 2.txt, and 3.txt.

Sample Output

Combine 3.1 - File Combining Utility - www.Gammadyne.com
1.txt: ok
2.txt: ok
3.txt: ok
Combined 3 files (126 bytes)

## DELNEXT.EXE

DELNEXT.EXE will schedule one or more files or folders to be deleted during the next reboot.  This is useful for deleting files that are currently in use (and therefore locked).

Usage

DELNEXT [/d"..."] [/move"..."] [/nologo] [/now] [/pause] [/s] files...

Switches:
 /d The default path where the files are located.  If omitted, the current working directory is used.  The path must follow the /d switch immediately (no spaces), and be surrounded in quotes. /move Instead of deleting, the file specified in this switch will replace the target file during the next reboot. /nologo Don't display the program banner. /now Delete the file immediately if possible. /pause Ask the user to press a key before terminating. /s Recursively enter subfolders.

Example #1

C:\dos>delnext c:\foo\example.txt

c:\foo\example.txt ... success

Example #2

C:\dos>delnext /d"c:\windows" /s "foo bar.dll" logon.exe

c:\windows\foo bar.dll ... success
c:\windows\system32\logon.exe ... success

Example #3

C:\dos>delnext /move"c:\temp\foo.dll" c:\windows\foo.dll

c:\windows\foo.dll ... success

Notes

• The * and ? wildcards are supported.
• The operating system will delete the file before any drivers are loaded or services are started.  This makes DELNEXT an excellent tool for ridding a system of viruses.
• Some viruses will detect when one of their files is missing, and restore it.  It is important to delete all of the files associated with the virus.
• Files cannot be located on a network share because they are deleted before networking support is booted.
• Folders must be empty in order to be deleted.
• Deleted files are not moved to the Recycle Bin, they are permanently deleted.  For a good undelete utility, we recommend Back2Life.
• Because the system deletes the file, the presence of delnext.exe is not required.  Hence, delnext.exe can be deleted after it is used.  This makes it useful as part of a software uninstaller.
• The registry key where delayed deletions and moves are located is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
in the value named "PendingFileRenameOperations".

## DELS.EXE

DELS.EXE will delete a set of files from a folder and all of its subfolders.  Only one parameter is required:  a specification of the files to be deleted.  The specification can use the ? and * wildcards.  Multiple specifications can be separated with a space or semi-colon.

Usage

DELS [/age##] [/dif] [/nf] [/nologo] [/nr] [/ns] [/nw] [/q] [/shred] [/test] filespec [/xf filespec] [/xd folder]

Where filespec specifies the file(s) to be deleted.

Switches:
 /age## Only delete files that are at least this age, in days. /dif On failure, delete the file during the next reboot.  May require admin rights. /nf Don't list each file as it is deleted. /nologo Don't display the program banner. /nr Don't recursively enter subfolders. /ns Don't display the operation summary. /nw Don't report warnings in the file specification. /q Suppress all output. /shred Shred the file so that it cannot be recovered.  Complies with NIST SP-800-88 guidelines. /test Test only - no deleting. /xd Exclude each folder that follows this switch. /xf Exclude each file that follows this switch.

Example

For example, Gammadyne uses this to delete all of our object code files:

dels /nf /age7 f:\projects\*.obj;*.sbr;*.res;*.bsc;*.pch;*.ncb

Sample Output:

DELS.EXE 4.0 - Recursive File Deletion Utility - www.Gammadyne.com

Deleting F:\PROJECTS\AutoTweak\AutoTweak.ncb : ok
Deleting F:\PROJECTS\Scratchboard\Scratchboard.ncb : ok
Deleting F:\PROJECTS\Console\Console.ncb : ok
Deleting F:\PROJECTS\All\All.ncb : ok
Deleting F:\PROJECTS\Eclient\Eclient.ncb : only 3 days old

4 files deleted successfully
1 files could not be deleted
1 files were not old enough
Total size of file specification: 34,741,983 bytes

Notes

• We are not responsible for damage caused by the use of this program, or any other program, even if it contains bugs.  This is a powerful program with the ability to seriously screw up your computer.
• You may press the Escape key to abort the operation once it has started.
• When a file specification contains an absolute path, all subsequent file specifications will be relative to that path (but only when using a semi-colon separator).  Note that the example above depends on this.
• Deleted files are not moved to the Recycle Bin, they are permanently deleted.  For a good undelete utility, we recommend Back2Life.

## DIGSIG.EXE

DIGSIG.EXE is a utility that can apply a digital signature to an .EXE or .DLL, or verify an existing signature.

Usage

DIGSIG filepath [/folder] [/nologo] [/ns] [/sign cert-filepath password]

Switches:
 /folder Instead of processing just a single file, processes all files in a folder.  Press Escape to abort. /nologo Don't display the program banner. /ns Don't recursively enter subfolders (only applies to /folder). /sign Sign the file with the specified certificate and password.  The certificate must be in either PFX or P12 format.  If you are running Windows 8 or later, it will be signed with both SHA-1 and SHA-256, otherwise SHA-256 only.

Output

When verifying a signature, the %ErrorLevel% environment variable will be set to one of the following:

 Code Description -1 Invalid parameter. 0 The signature is present, and was validated successfully. 1 No signature is present. 2 Failed to find the signature. 3 The signature is present, but the file is not allowed. 4 The file is not trusted. 5 Admin policy has disabled user trust. 6 Failed to link to WinVerifyTrust() in WinTrust.DLL. 7 An unknown error occurred. 8 The file does not exist. 9 The file is locked. 10 Unsupported file type. 11 A certificate was revoked by the issuer. 12 A certificate is expired. 13 The signature or certificate is malformed. 14 The signature could not be verified. 15 A parameter was invalid.

Example #1 - verifying a signature

>digsig c:\work\foo.exe
DigSig 3.0 - Digital Signature Verification Utility - www.Gammadyne.com

Code 11: A certificate was revoked by the issuer.

Example #2 - verifying all files in a folder

>digsig /folder c:\work
DigSig 3.0 - Digital Signature Verification Utility - www.Gammadyne.com

c:\work\foo.exe : No signature is present.
c:\work\bar.exe : The signature is present, and was validated successfully.
c:\work\baz.exe : The file is not trusted.

Example #3 - signing a file

>digsig "c:\work\foo.exe" /sign "c:\certs\cert.p12" abc123
DigSig 3.0 - Digital Signature Verification Utility - www.Gammadyne.com

The file was signed successfully.

## FCMP.EXE

FCMP.EXE compares two files, reporting whether or not they are the same.

Usage

FCMP [/e#] [/f] [/ff"*.xyz"] [/i#] [/n#] [/nologo] [/nr] [/s] [/sdo] [/snp] file1 file2

Compares file1 to file2, and reports if they are the same size and identical, byte for byte.

Switches:
 /e End at specified offset. /f Compare all files in two folders. /ff Only compare files that match the filter (/f only). /i Start at specified offset. /n Compare only the specified number of characters. /nologo Don't display the program banner. /nr Don't recursively compare subfolders (/f only). /s Suppress all output. /sdo Only compare files if they have the same date (/f only). /snp No error if one of the files has no counterpart (/f only).

Example - Comparing Files

fcmp c:\work\foo.txt d:\work\bar.txt

Sample Output:

FCMP 4.3 - File Comparison Utility - www.Gammadyne.com

Files are identical.

Sample Output:

FCMP 4.3 - File Comparison Utility - www.Gammadyne.com

Files differ at offset 0
'2' (50) != '1' (49)

Example - Comparing Folders

fcmp /f /ff"*.txt;*.log" /sdo /snp c:\work\ d:\backup\work\

Sample Output:

FCMP 4.3 - File Comparison Utility - www.Gammadyne.com

Folders are identical.
312 files were matched.