Gammadyne Corporation

Gammadyne's Free DOS Utilities

Gammadyne Corporation offers the following DOS command line programs which you may download and use freely.

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.
  • Send comments here.


Program Index

backup9.exe BACKUP9.EXE - File Backup Utility
combine.exe COMBINE.EXE - File Combining Utility
delnext.exe DELNEXT.EXE - Delete At Next Reboot Utility
dels.exe DELS.EXE - Recursive File Deletion Utility
digsig.exe DIGSIG.EXE - Digital Signature Utility
fcmp.exe FCMP.EXE - File Comparison
firewall.exe FIREWALL.EXE - Windows Firewall Configuration Utility
gpatch.exe GPATCH.EXE - File Patching Utility
gs.exe GS.EXE - Greg's DOS Shell
numlines.exe NUMLINES.EXE - Source Code Line Counter
pechksum.exe PECHKSUM.EXE - Portable Executable Checksum Utility
sizeof.exe SIZEOF.EXE - File Size Reporting Utility
sleep.exe SLEEP.EXE - Power Management Utility
startas.exe STARTAS.EXE - Executes a DOS command line under a different user account.
timer.exe TIMER.EXE - Timer Utility
wol.exe 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:
/aAlways perform backup, even if no change since last backup.
/eReplace the source file's extension instead of appending.
/iIgnore errors in the file specification.
/lNumber of backup levels, from 1 to 999 (defaults to 9).
/mMaintain the folder structure.  This is only applicable with the /s switch and a target path.
/nologoSuppress logo banner.
/qQuiet mode - no banner or operation status.
/sRecursively enter sub-folders.
/vVerbose 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


Download

Click here to download version 3.0 of BACKUP9.EXE (released June 12th, 2019).

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:
/aDo not overwrite the existing contents of the target file.  Instead, append to the end of the target file.
/flThe 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).
/lbBefore 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.
/nolistDo not list each file.
/nologoDo not display the program banner.
/nosumDo not display the operation summary.
/sRecursively 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
Copyright (C) 2004-2019 by Greg Wittmeyer - All Rights Reserved
1.txt: ok
2.txt: ok
3.txt: ok
Combined 3 files (126 bytes)


Download

Click here to download version 3.1 of COMBINE.EXE (released October 13th, 2019).

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:
/dThe 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.
/moveInstead of deleting, the file specified in this switch will replace the target file during the next reboot.
/nologoDon't display the program banner.
/nowDelete the file immediately if possible.
/pauseAsk the user to press a key before terminating.
/sRecursively enter subfolders.

Example #1

C:\dos>delnext c:\foo\example.txt
Gammadyne Delete At Next Reboot Utility 5.1 (delnext.exe) - www.Gammadyne.com
Copyright (C) 2005-2019 by Greg Wittmeyer - All Rights Reserved

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


Example #2

C:\dos>delnext /d"c:\windows" /s "foo bar.dll" logon.exe
Gammadyne Delete At Next Reboot Utility 5.1 (delnext.exe) - www.Gammadyne.com
Copyright (C) 2005-2019 by Greg Wittmeyer - All Rights Reserved

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
Gammadyne Delete At Next Reboot Utility 5.1 (delnext.exe) - www.Gammadyne.com
Copyright (C) 2005-2019 by Greg Wittmeyer - All Rights Reserved

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".

Download

Click here to download version 5.1 of DELNEXT.EXE (released October 10th, 2019).

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.
/difOn failure, delete the file during the next reboot.  May require admin rights.
/nfDon't list each file as it is deleted.
/nologoDon't display the program banner.
/nrDon't recursively enter subfolders.
/nsDon't display the operation summary.
/nwDon't report warnings in the file specification.
/qSuppress all output.
/shredShred the file so that it cannot be recovered.  Complies with NIST SP-800-88 guidelines.
/testTest only - no deleting.
/xdExclude each folder that follows this switch.
/xfExclude 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
Copyright (C) 2001-2018 by Greg Wittmeyer - All Rights Reserved

Deleting F:\PROJECTS\AutoTweak\AutoTweak.ncb : ok
Deleting F:\PROJECTS\Scratchboard\Scratchboard.ncb : ok
Deleting F:\PROJECTS\Gammadyne Mailer\Gammadyne Mailer.ncb : FAILED!
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.

Download

Click here to download version 4.0 of DELS.EXE (released April 12th, 2018).

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:
/folderInstead of processing just a single file, processes all files in a folder.  Press Escape to abort.
/nologoDon't display the program banner.
/nsDon't recursively enter subfolders (only applies to /folder).
/signSign 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:

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

Example #1 - verifying a signature

>digsig c:\work\foo.exe
DigSig 3.0 - Digital Signature Verification Utility - www.Gammadyne.com
Copyright (C) 2010-2019 by Greg Wittmeyer - All Rights Reserved

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
Copyright (C) 2010-2019 by Greg Wittmeyer - All Rights Reserved

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
Copyright (C) 2010-2019 by Greg Wittmeyer - All Rights Reserved

The file was signed successfully.


Download

Click here to download version 3.0 of DIGSIG.EXE (released July 12th, 2019).

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:
/eEnd at specified offset.
/fCompare all files in two folders.
/ffOnly compare files that match the filter (/f only).
/iStart at specified offset.
/nCompare only the specified number of characters.
/nologoDon't display the program banner.
/nrDon't recursively compare subfolders (/f only).
/sSuppress all output.
/sdoOnly compare files if they have the same date (/f only).
/snpNo 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
Copyright (C) 1994-2018 by Greg Wittmeyer - All Rights Reserved

Files are identical.


Sample Output:

FCMP 4.3 - File Comparison Utility - www.Gammadyne.com
Copyright (C) 1994-2018 by Greg Wittmeyer - All Rights Reserved

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
Copyright (C) 1994-2018 by Greg Wittmeyer - All Rights Reserved

Folders are identical.
312 files were matched.
21 files had different dates.
4 files had no counterpart.


Notes

  • File offsets are 0-based.
  • The %ErrorLevel% environment variable will contain 0 if the files match, 1 if they do not, or 2 if a file could not be opened or read from.

Download

Click here to download version 4.3 of FCMP.EXE (released June 8th, 2018).