PaulSadowski.com 

Windows Cmd Shell
 Command Line Utility Programs
Download cmdutils.zip


Echo.exe
Echo echoes characters from the command line to the standard output. Unlike the built-in version of echo this version allows you to specify printf escape sequences (such as \n for a newline) and octal representations of characters.


\b BACKSPACE
\c Print line without NEWLINE
\f FORMFEED
\n NEWLINE
\r RETURN
\t TAB
\v vertical TAB
\\ backslash
\x the 8-bit character whose ASCII code is the 1-, 2-, 3- or 4-digit octal number x. The first digit must be zero.

Supports a switch, -n, that prevents echo.exe from echoing a carriage return/linefeed on it's output

Example usage:

C:\echo.exe %TIME%\n%DATE%
16:25:13.03
Fri 02/06/2004

c:\echo.exe -n "Hey " & c:\echo.exe you!
Hey you!


DF.exe
Displays free disk space.

usage: df [-c -b -f|-F -r|-R -w|-W [drive ...]

-f : include floppy disks
-F : do only floppy disks (local only)
-c : include CD-ROMs
-r : exclude remote disks
-R : do only remote disks
-b : (bare display) no header or footer or totals
-w : display output in a Windows Messagebox

Copyright 1996, 1998, 2000 by Paul R. Sadowski <aa089@bfn.org>.
All Rights Reserved. Licensed for noncommercial use.

Example: ([\\$]] indicates a remote disk if a share name can't be determined)
df
drive kbytes     used     avail  capacity
C:\ 20974428 16986443   3987984  81% [Volume has no label] (ntfs)
D:\ 18876981  5551128  13325852  29% v1d (ntfs)
E:\ 18876981  1255931  17621049  7% v12 (ntfs)
F:\ 21262315  7373111  13889204  35% vdf (ntfs)
H:\ 21056712 14853574   6203138  71% Dell Server (ntfs) \\bliss\c$
------------------------------------------------------
   101047417 46020187  55027227  46%


Max.exe, Min.exe, Norm.exe
These programs change the console window's current state (maximize, minimize, normal). They have no effect in full-screen mode.

Example:
@echo off
do something
min
do something else
max
do another thing
norm


Sleep.exe
Waits for specified number of seconds to pass.
sleep: sleep-time-in-seconds

Example:
rem sleep for 5 minutes
sleep 300


Shortname.exe
Displays the short (8.3 format) name of a path or file. (Works with local or UNC paths.)

Example:
C:\shortname \\bliss\c$\46664Concert.asf
\\bliss\c$\46664C~1.ASF


Fullname.exe
Displays the long name of a file or path. (Does NOT work with UNC paths.)

Example:
C:\fullname c:\PROGRA~1\Adobe\ACROBA~1.0\Acrobat\Ace.dll
c:\Program Files\Adobe\Acrobat 6.0\Acrobat\Ace.dll


Uptime.exe
Displays the time since the machine's boot.

Example:
C:\uptime
4:50:26pm up 3 days, 22:18


Which.exe
Displays which copy of a file would be executed.
Which uses the PATH environment variable to determine which file would be executed. Which also uses the PATHEXT variable if you do not specify an extension to the file used in the argument.

Example:
C:\which which
.\which.exe

C:\which mywanip
c:\bin\mywanip.vbs


Msgbox.exe
Displays a simple informational GUI message box with the text you want to display.

Example:
C:\Msgbox Finished run at %DATE% %TIME%

@echo off
if NOT EXISTS c:\somedir\somefile.dat
C:\Msgbox File c:\somedir\somefile.dat does not exist! & goto :EOF
 

 

© 2003 by Paul R. Sadowski   
All Rights Reserved. Used By Permission.  
Comments to: Scripting