This page lists some console utilities (and one GUI based utility) I wrote in C#.
To allow using them in batch files, most utilities return their results as errorlevels.
Check the source code and the command line help text to translate the return codes/errorlevels back to results.
Some of these utilities were tested in Windows XP, all of them in Windows 7.
They were compiled with Visual Studio 10 Express Edition, with the target framework set to .NET Framework 4 Client Profile.
| Click the floppy disk icons to download the ZIPed sources. | |
| Click the question mark icons to view the MD5 and SHA1 checksums for the ZIPed sources. | |
| Click the program name to view its source code. |
| C# Examples | ||||||
|---|---|---|---|---|---|---|
| Name | Version | Description | Last modified | Remarks | ||
| Asc | 1.00 | Return the decimal character code for the specified ASCII character | 2012-05-11 | |||
| CameraModel | 2.00 | Return the camera model for the specified image file | 2012-10-16 | This utility searches only the first kilobyte of the specified image file, which makes it a lot faster than FINDSTR or STRINGS. | ||
| CanonModel | 1.00 | Return the Canon camera model for the specified image file | 2012-10-07 | This utility searches only the first kilobyte of the specified image file, which makes it a lot faster than FINDSTR or STRINGS. | ||
| CapsLock | 1.01 | Read or set CapsLock key state | 2012-06-28 | |||
| CaptureDate | 1.00 | Return the capture date and time for the specified image file | 2013-02-13 | This utility searches only the first kilobyte of the specified image file, which makes it a lot faster than FINDSTR or STRINGS. | ||
| Chr | 1.00 | Return the ASCII character for the specified decimal character code | 2012-05-10 | |||
| ClCalc | 1.00 | Command Line Calculator | 2012-05-14 | Based on code by "markman", found in a discussion section of CodeProject.com. | ||
| CloneDate | 0.50 BETA | Modify the LastModified date (timestamp) of the target file(s) to match the specified source file's timestamp | 2012-07-19 | |||
| Drives | 2.00 | List available and/or used drive letters | 2012-06-25 | Based on code found at DreamInCode.com. Unlike ListDrives.exe, Drives.exe does not require elevated or administrative permissions. |
||
| FastPing | 1.00 | Faster PING alternative | 2012-09-25 | |||
| GetMyPID | 1.00 | Return the parent process' PID. | 2011-05-16 | Requires ParentProcess.cs by Jared Barneck | ||
| GetTitle | 4.00 | Read the current Window's title, optionally removing the "Administrator:" prefix if running with elevated privileges (Vista and later), and optionally removing the appended command line. | 2011-05-10 | As of version 4.00, GetTitle works in "all" Windows versions, rendering GetTitleXP, the separate XP version, obsolete. | ||
| HideInput | 1.00 | Read 1 line of keyboard input while hiding what's being typed, by temporarily setting the console foreground color equal to its background color. | 2012-09-29 | |||
| is6432os | 1.00 | Return "errorlevel" 64 if current OS is 64-bit, or 32 if it is 32-bit | 2010-07-04 | |||
| isDST | 1.01 | Return "errorlevel" 0 if a date is in Daylight Saving Time, or 2 if it isn't | 2012-06-28 | |||
| IsElevated | 1.00 | Return "errorlevel" 0 if current process has elevated privileges, or 1 if not | 2011-01-03 | |||
| IsFAT | 1.00 | Return "errorlevel" 0 if the specified drive is FAT formated, 2 if not, or 1 if not ready | 2011-04-22 | |||
| IsNTFS | 1.00 | Return "errorlevel" 0 if the specified drive is NTFS formated, 2 if not, or 1 if not ready | 2011-04-22 | |||
| IsRedirected | 1.01 | Return a number containing the redirection status of StdIn (+2), StdOut (+4) and StdErr (+8) | 2012-06-19 | |||
| ListDrives | 1.10 | Return a string containing all drive letters in use | 2011-04-06 | Unlike Drives.exe, ListDrives.exe requires elevated or administrative permissions. | ||
| ListNICs | 1.00 | List physical network adapters | 2011-11-01 | |||
| ListPrinters | 1.10 | List all available local printers | 2011-04-06 | |||
| LoCase | 1.02 | Convert filenames to all lowercase | 2012-07-23 | |||
| NewTempFile | 1.00 | Create a zero-byte temporary file and display its name on screen | 2012-07-02 | |||
| NumLock | 1.01 | Read or set NumLock key state | 2012-06-28 | |||
| Paste | 1.01 | Read and display text from clipboard | 2011-06-25 | |||
| PDFPageCount | 1.02 | Return the page count for the specified PDF file(s) | 2011-10-13 | Based on sample code by Dharmaraj Nagarajan | ||
| PingSite | 1.21 | Check if a website is up and running | 2011-10-18 | |||
| PrintAny | 3.01 | Print files using the print command or verb registered for the file type | 2012-11-13 | Not all file types have registered Print(To) commands or verbs | ||
| Printing | 2.31 | Pause or resume printing, or flush all queued printjobs on the specified printer(s), or list all printers, their status and number of printjobs | 2012-12-21 | Requires PrinterInfo.cs by Bas van der Woude | ||
| PrintScreen | 1.00 | Save a screenshot as image or save the current console buffer as text | 2012-10-02 | Credits: Code to read console buffer by Simon Mourier; code for graphic screenshot by Ali Hamdar | ||
| ReadLine | 0.30 beta | Read the specified line(s) from a text file or from standard input | 2012-05-19 | |||
| RxGrep | 2.00 | Multi-line FindStr/Grep like tool | 2012-12-11 | See the FINDSTR page for a usage sample | ||
| ScrollLock | 1.01 | Read or set ScrollLock key state | 2012-06-28 | |||
| StringHash | 1.01 | Return the MD5 or SHA* hash value for the specified string | 2010-07-29 | |||
| Tail | 1.00 | Return the specified number of lines from the end of the specified file or input stream | 2012-05-20 | Code to detect redirection by Hans Passant on StackOverflow.com. | ||
| Tee | 1.02 | Redirect Standard Input to Standard Output and to a file | 2012-07-11 | Code to detect redirection by Hans Passant on StackOverflow.com. | ||
| TranslateCulture | 1.00 | List translations for weekdays and/or month names for the specified cultures (languages) | 2011-05-18 | |||
| UpCase | 1.02 | Convert filenames to all uppercase | 2012-07-23 | |||
| WaitASecond | 1.00 | A 900..1100 milliseconds random time delay | 2011-05-11 | |||
| WANIP | 1.02 | Get the computer's WAN IP address | 2011-06-27 | |||
| WGetLite | 1.00 | Get web content (text only) | 2011-04-14 | |||
| Which | 1.30 | Port of the UNIX command to Windows | 2012-06-11 | |||
| Wireless | 1.00 | Monitor an 802.11 wireless connection | 2012-07-06 | This is a GUI based program, not a command line utility. | ||
| page last uploaded: 18 November 2012, 19:57 |