DSToolBox ::

command line utilities for Windows...

logo

DSToolBox is a group of command line applications I have written over years that continue to evolve as the need arises. Most of these applications I use on a daily basis in combination with batch files to accomplish various tasks. After some friendy prodding from users on DonationCoder.com I have decided to wrap them up in a single download in the hopes that someone will find them useful. They are all written in C++ and optimized to be as small and fast as possible.
portableDownload self-extracting archive ( no installer, includes local runtime ) [~1.5Mb]
Conventions:

I use the following libraries in many of my command line tools:

Since I use TCLAP, all of my command line options look similar.

-h is help ( most of the time )
--version is version
-d is detailed output ( most of the time )
-I ignores errors and keeps processing

Most tools that take a file list or wildcards allow the following:

a list of files/wildcards can be passed in using ';':

c\:>lnkchk -r *pad*.lnk;*w*.lnk;

The files can be read in from a file list by using the @ character:

c\:>lnkchk -r @file.lst

The file list format is simple, a file name terminated by end-of-line.
The cool thing about file lists is that they can contain links to other lists.
You can do this by using the @ character in the file list to point to another list.
You can also use environment variables by putting them in <>
File lists can contain comments, any line starting with a ';' is a comment.
If you want comments output to the screen during processing use the -w switch.

If you don't put a full path to a file list, in a file list, it searches relative to the parent list.
For example:

;This is an example list
c:\temp\sometext.txt
@c:\temp\files.lst
@more_files.lst
@more\even_more_files.lst
@<ALLUSERSPROFILE>\*.txt
First line is a comment
Second line is a absolute path to a file
Third line points to another list file
Fourth line points to another list file that is going to be in the same dir as the parent list file
Fifth line points to a list file in a directory under the parent list file
Sixth line contains a environment variable and a wildcard to reference any text file under the all user's profile area

Most applications that support file lists also support getting file list input from a pipe.

For example you could do something like this:

c\:>dir /b *.lnk | lnkchk -d @@

The @@ tells the application to read the list from the pipe.
This is example is pretty useless since lnkchk supports wildcards on it own for finding files, but you get the idea.
Bang

Bang Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Sep 10 2009 @ 22:06:10

USAGE:

    ! [-i] [-g <string>] [-h] [-v] [-w] [-d] [-p] [-f <string>] [-s] [--] <string> ...

Where:

    -i, --Insensitive
     Ignore case in regex search.

    -g <string>, --grep <string>
     grep search

    -h, --help
     show help

    -v, --version
     show version

    -w, --wait
     don't wait

    -d, --detailed
     Maximum verbosity..

    -p, --path
     Dump path

    -f <string>, --find <string>
     Find a file in the DB

    -s, --search
     Search for executables..

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    <string> (accepted multiple times)
     command strings

    Beat the path limit.

Tutorial

This app is going to take a little bit of explaining...

I recently ran into problems when working in a command line environment. The first problem was that I needed to maintain a clean evironment PATH so that there were no clashes between program names and I could be sure my environment was the same as everyone elses. The second problem was that there is a limit in windows to the size of the console space on the command line and I had far more path entries that I wanted to reference, and I also didn't want to maintain them by hand.

On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters.

This limitation applies to the command line, individual environment variables (such as the PATH variable) that are inherited by other processes, and all environment variable expansions. If you use Command Prompt to run batch files, this limitation also applies to batch file processing. ( KB830473 )

To get around this I decided to write a simple command line application launcher called Bang.

The first thing you are going to want to do is to build a database of applications. You do this by changing to the directory you want to be the root of your search. I keep all my utilities on an external drive that allways maps to E: and the utilities are in a directory called utils. So I CD into that directory and execute the following:

E:\utils>! -s 

You can also add the -d switch to get extra information as it runs.

Bang will use the PATHEXT environment variable to determine executable extensions

Bang will only work indexing and running on the same drive. Bang only stores relative paths, it does not store drive letters. I purposely did this because my external drive letter can change and I wanted my database to be uneffected by the drive letter change. So when Bang runs an application it references it from the root of the drive. For example the XML file that stores the entries looks like this for my copy of grep:

<ITEM APP="sgrep.exe" PATH="\utils\toolbox" \>

Bang is running on the same drive as sgrep.exe, so when it goes to create the sgrep process it uses E:\utils\toolbox\sgrep.exe to launch it.

This is intentional and by design

The only requirement is that Bang (!.exe) is in your path.

Once you have indexed your files you can do some other things besides lauch applications.

You can dump out the database as a PATH if you need to use it in a batch file somewhere by using the -d switch.
You can find an exact file in the DB by using the find switch -f:

E:\>! -f sgrep 

This will look for sgrep and return the path to the first executable file it finds in the DB

If you can't remember the exact name, you can search using regular expressions:

E:\>! -g .*grep.* 

This will return a list of all executable matches. If you want the full path, add the -d option to get more info

The -w is important for windowed applications, because Bang will wait for the child process to exit. So if you are launching something like notepad use the -w switch to tell Bang not to wait around for it to return.

To use bang to launch command line apps ( from the command line ) and from in a batch file just use the '!' followed by the command and all the parameters:

C:\>! grep "fail|FAIL" *.log

Just a few things to remember. You can't pipe stuff to bang, so something like this is bad:

C:\>! grep "fail|FAIL" *.log | ! tee

If you are using Bang to execute batch files, remember that they execute in a child process, so any environment variables that get set will not propagate up to the cmd shell running Bang, they will be gone as soon as the batch file exits.

Banner

banner Copyright (c) ChalkTrauma, DreamCycle.net 2009
A DSToolBox Release.
All rights reserved.
1.0.0 Sep 8 2009 @ 13:32:10

USAGE:

    banner [-o <string>] [-t <string>] [-f <string>] [-w <integer>] [-c <string>] [-n] [-a] [-k] [-s] [--] [--version] [-h] <string> ...

Where:

    -o <string>, --output <string>
     Where to output: STDOUT or STDERR

    -t <string>, --type <string>
     Type of box: CENTER or LEFT

    -f <string>, --fill <string>
     The fill character

    -w <integer>, --width <integer>
     Width of box in chars.

    -c <string>, --colors <string>
     Defind colors: inside_box,outside_box

    -n, --no_trim
     Don't trim the text

    -a, --adjust
     adjust to fit text

    -k, --speak
     Speak the words, don't print

    -s, --show
     Show supported colors..

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <string> (accepted multiple times)
     text strings

    Makes colorful text boxes on the screen

Tutorial

A picture is worth a 0x3E8 words..

Most of the switches/parmeters are self explanatory.

-o sends the output to either STDOUT or STDERR, the default is STDOUT
-f sets the fill character the default is a space
-w sets the width of the box
-a adjusts the width to the size of the text
-s shows the colors available
-n doesn't trim spaces or tabs
-k uses Text-To-Speech to speak the text
You can put multiple text strings on a line like so:

c:\>banner -w 60 -t CENTER -c fgHiWhite,fgHiRed This is a test

Which gives you the following:

You can also pipe in stuff to banner like this:

c:\>type dc.txt | banner -n -t LEFT -c fgHiWhite,fgHiGreen @@

By using the '@@' you tell banner to get its input from the pipe.

This looks like:

Of course this only looks good because I kept the lines in the text file under 60 chars. Banner will not wrap text it will truncate it to make it fit.

BlueGuard

BlueGaurd Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Oct 14 2009 @ 23:01:00

USAGE:

    BlueGuard [-a <string>] [-i <int>] [-t <int>] [-r <int>] [-w <string>]
     [-l] [-d] [--] [--version] [-h]

Where:

    -a <string>, --action <string>
     do action: lock or path to program to run, default lock

    -i <int>, --idle <int>
     set idle: default 30

    -t <int>, --timeout <int>
     set timeout: default 3

    -r <int>, --retry <int>
     retry connection: default 1

    -w <string>, --watch <string>
     watch MAC

    -l, --list
     List devices per radio

    -d, --detailed
     Maximum verbosity..

     --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    Lock workstation by bluetooth range.

Tutorial

BlueGuard was written to get some experience with the Microsoft™ Bluetooth APIs.

Since Bluetooth is a wireless protocol it can be a bit flakey, so if you use this program be prepared to fine tune it to match your needs.

This program will most likely only work with the Microsoft Bluetooth stack! That's right people, bluetooth is not bluetooth is not bluetooth. Different vendors choose to implement things differently, that is the great thing about standards; there are so many to choose from. I use to have the Broadcom (widcomm) stack installed on my laptop, because this is what the vendor had installed. With XP SP2, Microsoft implemented their own Bluetooth stack and drivers. So I uninstalled the Broadcom drivers and installed Microsoft's, just to get a bit more compatibility. I found these two articles to be some help:

Start by using the (-l) switch to have it scan for available bluetooth devices:
c:\>blueguard -l

Device name: LG VX8600
Local address: (00:1F:E1:ED:4B:4B)
Device address: (00:1C:62:32:C2:95)

        Service instance name: BT DIAG
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):16

        Service instance name: OBEX Object Push
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):6

        Service instance name: OBEX File Transfer
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):7

        Service instance name: Bluetooth Modem
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):8

        Service instance name: Voice Gateway
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):3

        Service instance name: Voice Gateway
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):4

        Service instance name: AV Audio Source
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):25

        Service instance name: AV Remote Control Target
        Service instance comment:
        Device address: (00:1C:62:32:C2:95):23

From the listing above, you can see that it found my phone:
Device name: LG VX8600
Local address: (00:1F:E1:ED:4B:4B)
Device address: (00:1C:62:32:C2:95)

The Device address is the MAC address of the device.

This is the string we need to give to blueguard.

Unfortunately there is really no good way to determine if a device has enterered or left range without trying to contact it. There is not a isDeviceInRange function, and listing the devices like I have done above means the system "knows about" the devices and not necessarily that they are in range. For instance, I can turn off my phone and run using the (-l) switch again and I will get the same listing because the system "remembers" the devices. Doing a simple query for services on that device, basically pinging the device, using a timeout interval is what I use to determine if a device has entered or left range.

Basically the logic goes like this:

I would suggest the following settings:

c\:>BlueGuard.exe -w (00:1C:62:32:C2:95) -t 10 -r 2 -i 30

The above command line tells BlueGuard to watch (-w) for the MAC address (00:1C:62:32:C2:95), to sleep (-t) for 10 secs before trying again, to retry (-r) finding the device 2 times before considering it out of range, and to wait (-i) for 30 seconds with no input from the user before considering the system idle.

I find this set up to work the best and get the least amount of false screen locks without too much lag time.

If you want more info about what blueguard is doing, use the (-d) switch to turn on detailed output.

DebugString

DebugString Copyright (c) ChalkTrauma, DreamCycle.net 2009.
All rights reserved.
1.0.0 Sep 8 2009 @ 11:02:36

USAGE:

    debugstring [-c] [-e] [--] [-v] [-h] <string> ...

Where:

    -c, --clear
     Clears DebugView

    -e, --echo
     Echo to STDOUT.

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    -v, --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <string> (accepted multiple times)
     (value required) strings

    Pipes STDOUT to debugstream..

Tutorial

DebugString is a simple program that works with SysInternals Debugview, https://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

This allows you to view debug output in real time. This can be very helpful if you are debugging scripts and batch files and especially useful if you are piping input from one command line tool to another and want to peek at the input. This works just like the *nix tee command.

Let say for example you are piping a bare directory output to some other tool that takes a list of files from STDIN and zips them up. The line in a batch file might look like this:

c\:>dir /b | zipit.exe files.zip

To peek into the output of dir you would write something like the following:

c\:>dir /b | debugstring -e | zipit.exe files.zip

In the above case we use the -e switch to tell debugstring to echo it's input to STDOUT, otherwise debugstring would swallow all the input and zipit.exe would see nothing. If we have DebugView open when this line is executed, the file names sent to zipit.exe will stream to the viewer in real time.

Another use of debugstring is to view variable values or to trace execution.

In a batch file you could do the following:

c\:>echo %PATH% | debugstring

The above line would echo the path variable to the debug monitor

You can also use debugstring to send simple messages to the debug monitor:

c\:>debugstring -e "This is a simple message.."

    or
c\:>debugstring one two three four

The two examples above will send strings directly to the debug monitor. The first example will echo the message to the screen as well as send the string to the debug monitor because the -e switch was used. The second example will send 4 separate strings to the debug monitor which will print on 4 separate lines, strings are broken on spaces unless surrounded by quotation marks.

You can clear the display first by using the -c option

getVersion

GetVersion Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Oct 1 2009 @ 22:31:27

USAGE:

    getversion [-t] [-f] [-I] [-r] [-s] [--] [--version] [-h] <Find Spec>

Where:

    -t, --trim
     Trim filename

    -f, --found
     Only show found versions

    -I, --Ignore
     Ignore all errors and keep going.

    -r, --recurse
     Recurse through dirs

    -s, --show
     Show list file comments

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <Find Spec>
     Executable to look for.

    Displays version info for files.

Tutorial

getVersion gets the verison information from windows executables.

For example if you want to get the version information from notepad.exe:

C:\>getversion C:\windows\notepad.exe

C:\windows\notepad.exe
    Microsoft« Windows« Operating System
    Microsoft Corporation
    (c) Microsoft Corporation. All rights reserved.
    none
If you want the version information for every DLL in a directory:

C:\>getversion *.dll

If you want version information for every exe and dll in a directory tree, skipping output for programs that don't have version information:

C:\>getversion -rf *.dll;*.exe 

hashGen

hashGen Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Oct 15 2009 @ 15:02:59

USAGE:

    E:\utils\toolbox\hashgen.exe [-d] [-w] [-I] [-c <string>] [-r] [-s] [-t
<string>] [--] [--version] [-h] <Source Spec>

Where:

    -d, --detailed
     Maximum verbosity..

    -w, --show
     Show list file comments.

    -I, --Ignore
     Ignore all errors and keep going.

    -c <string>, --compare <string>
     Compare hash

    -r, --recurse
     Recurse through file system..

    -s, --sum
     Sum hash.

    -t <string>, --types <string>
     Digest types supported:

     crc32

     md4

     md5

     ripemd128

     ripemd160

     ripemd256

     ripemd320

     sha1

     sha224

     sha256

     sha384

     sha512

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <Source Spec>
     hash source, can be @filename to read from a names file, can be @@ to
     read from stdin.

    Generate hashes for files.

Tutorial

hashGen is a tool for generating hashes for files or groups of files.

For example to generate an md5 hash for notepad.exe I would do the following:

C:\>hashGen -t md5 windows\notepad.exe 

Gives the following output:

md5:     5e28284f9b5f9097640d58a73d38ad4c     windows\notepad.exe
    
1 files processed in 15 ms.

You can also generate more than one type of hash at a time by adding them to the command line:

C:\>hashGen -t crc32;md5;sha1;sha256 windows\notepad.exe 

crc32:     877ea041     windows\notepad.exe
md5:     5e28284f9b5f9097640d58a73d38ad4c     windows\notepad.exe
sha1:     7a90f8b051bc82cc9cadbcc9ba345ced02891a6c     windows\notepad.exe
sha256:     865f34fe7ba81e9622ddbdfc511547d190367bbf3dad21ceb6da3eec621044f5     windows\notepad.exe

1 files processed in 31 ms.

You can also generate hashes for goups of files by using the sum (-s) switch and the recurse (-r) switch, for example:

C:\>hashGen -t md5 windows\n*.exe -r -s 

md5:     c537d37795086385c3f10a8663cb6f3a

176 files processed in 21750 ms.

You could also search for a file by it's hash by using the compare (-c) switch:

C:\>hashGen -t md5 windows\*.exe -c 5e28284f9b5f9097640d58a73d38ad4c

md5:     cc192386468bd7faf7624155877a7d2a     windows\lsb_un20.exe
md5:     5e28284f9b5f9097640d58a73d38ad4c     windows\lsb_un20.exe     ** matched **
md5:     058710b720282ca82b909912d3ef28db     windows\regedit.exe
md5:     afab870a40df457165c83896e546fe92     windows\setdebug.exe

26 files processed in 1657 ms.

This gives me a way of finding a duplicate file even if the name has changed.
jVerison

JVersion Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Oct 1 2009 @ 11:39:56

USAGE:

    jversion [-a <string>] [-c <string>] [-w] [-I] [-r] [-d] [--]
     [--version] [-h] <fileNameString> ...

Where:

    -a <string>, --archive <string>
     Look in archives

    -c <string>, --compare <string>
     Compare version <=>!

    -w, --show
     Show list file comments.

    -I, --Ignore
     Ignore all errors and keep going.

    -r, --recurse
     Recurse through file system..

    -d, --detailed
     Maximum verbosity..

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <fileNameString> (accepted multiple times)
     file names

    Display version info from class files.

majorminorJDK
4531.0
4531.1
4601.2
4701.3
4801.4
4901.5
5001.6
Tutorial

jVersion is a program that reads the version information from Java class files and displays both the java class file signature and the version information.

For example:

C:\>jversion test.class 

Produces the following output:

0xCAFEBABE : 49.00 : C:\temp\test.class

This class was compiled using a Java 1.5 JDK.

This is usefull for quick checks on class files, but is more usefull for searching in archives.

For example:

C:\>jversion -r -a JAR *Gregorian.class

Run in my Java 1.6 JRE lib direcectory produces the following output:

Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\charsets.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\deploy.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\javaws.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\jce.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\jsse.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\management-agent.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\plugin.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\resources.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\rt.jar
0xCAFEBABE : 49.00 : sun/util/calendar/Gregorian.class
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\security\local_policy.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\security\US_export_policy.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\im\indicim.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\im\thaiim.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\ext\dnsns.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\ext\localedata.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\ext\sunjce_provider.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\ext\sunmscapi.jar
Processing archive: C:\Program Files\Java\jre1.6.0_07\lib\ext\sunpkcs11.jar

The search found Gregorian.class in the rt.jar and lists it as being from JDK 1.5.

Notice in my command line how I had to use *Gregorian.class. This is because the spec matching does not see the '/' character in the archive as a path separator, it sees it as one long file name, so you need the '*' to represent the path before the classname.

By using the comparison '-c' switch you can look for classes in a range of versions. For example:

C:\>jversion -r -a JAR *Gregorian.class -c ">48"

This looks for the Gregorian.class only if it has a version greater than 48. The value needs to be surrounded by quotes (") because the > effects the command line and would cause it to try to redirect output. The comparison operators are (<=>).

lnkchk

lnkhck Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Sep 28 2009 @ 23:52:28

USAGE:

    lnkchk [-c] [-w] [-I] [-r] [-d] [--] [--version] [-h] <fileNameString> ...

Where:

    -c, --check
     Check file link.

    -w, --show
     Show list file comments.

    -I, --Ignore
     Ignore all errors and keep going.

    -r, --recurse
     Recurse through file system..

    -d, --detailed
     Maximum verbosity..

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <fileNameString> (accepted multiple times)
     file names

    Check windows shortcut link files.

Tutorial

lnkchk is a very simple command line shortcut checking and reporting tool

Here is an example of a very simple run:

This looks in every directory below the current working directory for any *.lnk file and dumps out the information

C:\>lnkchk -rd 

Output will look something like this:

===============================================================================================
SHORTCUT:     [ C:\Documents and Settings\All Users\Start Menu\Programs\Accessories\WordPad.lnk ]
PATH:         [ C:\Program Files\Windows NT\Accessories\wordpad.exe ]
DESCRIPTION:  [ Creates and edits text documents with complex formatting. ]
NAME:         [ WordPad ]
ICON FILE:    [ C:\Program Files\Windows NT\Accessories\wordpad.exe ]
ARGUMENTS:    [  ]
WORKING DIR:  [ %HOMEDRIVE%%HOMEPATH% ]
ICON POS:     [ 0 ]
SHOW CMD:     [ 1 ]
HOTKEY:       [ 0 ]
REL PATH:     [ ..\..\..\..\..\Program Files\Windows NT\Accessories\wordpad.exe ]
TYPE:         [ filesystem ]
===============================================================================================

To actually check links add the -c parameter:

C:\>lnkchk -rc 
Links pointing to missing files will look like the following:

### ERROR:
[C:\Documents and Settings\All Users\Start Menu\Programs\Tools\ThinkVantage\Keyboard Customizer Utility.lnk]
points to missing file:
[C:\Program Files\ThinkPad\Utilities\TpKmapAp.exe]

lnkchk accepts wildcards:

C:\>lnkchk -rc "C:\Documents and Settings\All Users\Start Menu\*"

C:\>lnkchk -rdc "C:\Documents and Settings\All Users\Start Menu\*"

SetColor

setColor Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Sep 8 2009 @ 15:26:00

USAGE:

    setcolor [-s] [-p <string>] [-r <string>] [-i] [-c <string>] [--] [--version] [-h]

Where:

    -s, --show
     showColors

    -p <string>, --profile <string>
     Use a syntax profile.

    -r <string>, --regex <string>
     Regular expression

    -i, --Insensitive
     Ignore case in regex search.

    -c <string>, --color <string>
     change color

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    Sets all color from text read from stdin.

Tutorial

It has two modes of operation. One mode, sets all color from text read from stdin, and the other reads a XML syntax file and uses regular expressions to colorize matched text. The colors supported are as follows:

  • bgBlack
  • bgGray
  • bgHiBlue
  • bgHiCyan
  • bgHiGreen
  • bgHiMagenta
  • bgHiRed
  • bgHiWhite
  • bgHiYellow
  • bgLoBlue
  • bgLoCyan
  • bgLoGreen
  • bgLoMagenta
  • bgLoRed
  • bgLoWhite
  • bgLoYellow
  • fgBlack
  • fgGray
  • fgHiBlue
  • fgHiCyan
  • fgHiGreen
  • fgHiMagenta
  • fgHiRed
  • fgHiWhite
  • fgHiYellow
  • fgLoBlue
  • fgLoCyan
  • fgLoGreen
  • fgLoMagenta
  • fgLoRed
  • fgLoWhite
  • fgLoYellow

This list can be generated on the command line by using 'setcolor -s'.

Lets say you wanted a directory listing to be in red:

c:\>dir | setcolor -c fgHiRed

Lets say you wanted just the <DIR> marker lines to be just in red:

c:\>dir | setcolor -c fgHiRed -r "\<DIR\>"

Or only dates in 2005:

c:\>dir | setcolor -c fgHiRed -r "[0-9]{2}/[0-9]{2}/2005"

A good use for setcolor is in batch files, to set sections apart from one another, for example

echo ################################################################################ | setcolor -c fgHiGreen
echo                    Building | setcolor -c fgHiGreen
echo ################################################################################ | setcolor -c fgHiGreen

This will output a green header

Let's also say that in your batch file you are going to be outputting a build log and you want to catch some errors, but you only want to highlight a certain word and not the whole line, that might look something like this:

build.cmd 2>&1 | setcolor -p BUILDsyntax
We use the '2>&1' here to link stderr to stdout so it gets piped to setcolor, otherwise it will go straight to the screen.

The -p tells setcolor to use a syntax profile to colorize text. It will look in the directory where setcolor is installed for a file called BUILDsyntax.xml. Whatever profile name you pass to setcolor, it will attatch .xml to it and look for that file in its directory. It will then use that data to colorize the text.

Here is an example of an XML syntax file:

<?xml version="1.0" encoding="UTF-16" standalone="no" ?>
<SYNTAX name="BUILD">
    
<KEYWORD COLOR="fgHiGreen">\[.+]</KEYWORD>
    
<KEYWORD ACTION="1" COLOR="fgHiRed">^BUILD FAILED</KEYWORD>
    
<KEYWORD COLOR="fgHiGreen">BUILD SUCCEEDED</KEYWORD>
    
<KEYWORD COLOR="fgHiGreen">BUILD SUCCESSFUL</KEYWORD>
    
<KEYWORD COLOR="fgHiRed">error</KEYWORD>
    
<KEYWORD COLOR="fgHiRed">Error</KEYWORD>
    
<KEYWORD COLOR="fgHiCyan">^Total time:.*</KEYWORD>
    
<KEYWORD COLOR="fgHiYellow">^[^:]+:</KEYWORD>
    
<KEYWORD COLOR="fgHiRed">NoClassDefFound</KEYWORD>
    
<KEYWORD COLOR="fgHiBlue">\(.+\)</KEYWORD>
    
<KEYWORD COLOR="fgHiMagenta">\".+\"</KEYWORD>
    
<KEYWORD COLOR="fgHiRed">was not found</KEYWORD>
    
<KEYWORD COLOR="fgHiRed">java.lang.ClassNotFoundException</KEYWORD>
    
<KEYWORD COLOR="fgHiYellow">:[0-9]+:</KEYWORD>
</SYNTAX>

All this syntax says is; match the regular expression contained in the tag and make it the color named in the COLOR attribute.

That's all there is to it, you can have as many syntax files as you want, you could even use it to show colorized source on the command line:

c:\>type index.html | setcolor -p HTMLsyntax
Of course this scrolls off the screen pretty quick, but you get the idea.

vsCMD

vsCMD Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Sep 10 2009 @ 23:15:37

USAGE:

    vscmd [-p] [-f] [-d] [--] [--version] [-h] <string> ...

Where:

    -p, --project
     load project

    -f, --file
     load file

    -d, --detailed
     Maximum verbosity..

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <string> (accepted multiple times)
     commands

    Send commands to VisualStudio.

Tutorial

This is just a simple DTE Interface wrapper to get at the Visual Studio automation object model from the command prompt, with a couple of shortcuts thrown in to make things easier.

For example to load a project into Visual Studio you can just do this:

C:\>vsCMD -p myproject.sln

This is really just shorthand for this:

C:\>vsCMD File.OpenProject myproject.sln

The other shorthand switch is -f which load a file into the IDE.

You can execute any DTE automation command from the command line

For example to move the cursor to line 100 of the currently selected editor you would do the following:

C:\>vsCMD Edit.GoTo 100

For more commands I suggest going here ( command reference )

WallChanger

WallChanger Copyright (c) ChalkTrauma, DreamCycle.net 2009.
A DSToolBox Release.
All rights reserved.
1.0.0 Sep 10 2009 @ 23:06:35

USAGE:

    Wallchanger [-s <int>] [--] [--version] [-h] <Source Spec>

Where:

    -s <int>, --style <int>
     0 = tiled, 1 = center, 2 = stretch

    --, --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

    --version
     Displays version information and exits.

    -h, --help
     Displays usage information and exits.

    <Source Spec>
     file source, can be @filename to read from a list file, can be @@ to read from stdin.

    Change Wallpaper from console.

Tutorial

This is a painfully simple console based wallpaper changer

Works like this:

C:\>wallchanger -s 2 e:\images\wallpaper.bmp

Where -s sets the wallpaper style 0 = tiled, 1 = center, 2 = stretched

That is all there is to it

portableDownload self-extracting archive ( no installer, includes local runtime ) [~1.5Mb]