This page lists some console utilities 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 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
| C# Examples | ||||||
|---|---|---|---|---|---|---|
| Name | Version | Description | Last modified | Remarks | ||
| CapsLock | 1.00 | Read or set CapsLock key state | 2011-04-04 | |||
| 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. | ||
| is6432os | 1.00 | Return "errorlevel" 64 if current OS is 64-bit, or 32 if it is 32-bit | 2010-07-04 | |||
| isDST | 1.00 | Return "errorlevel" 0 if a date is in Daylight Saving Time, or 2 if it isn't | 2011-04-04 | |||
| 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.00 | Return a number containing the redirection status of StdIn (+2), StdOut (+4) and StdErr (+8) | 2011-03-28 | |||
| ListDrives | 1.10 | Return a string containing all drive letters in use | 2011-04-06 | |||
| ListNICs | 1.00 | List physical network adapters | 2011-11-01 | |||
| ListPrinters | 1.10 | List all available local printers | 2011-04-06 | |||
| NumLock | 1.00 | Read or set NumLock key state | 2011-04-04 | |||
| 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 | |||
| Printing | 2.25 | Pause or resume printing, or flush all queued printjobs on the specified printer(s), or list all printers, their status and number of printjobs | 2011-04-01 | Requires PrinterInfo.cs by Bas van der Woude | ||
| ScrollLock | 1.00 | Read or set ScrollLock key state | 2011-04-04 | |||
| StringHash | 1.01 | Return the MD5 or SHA* hash value for the specified string | 2010-07-29 | |||
| TranslateCulture | 1.00 | List translations for weekdays and/or month names for the specified cultures (languages) | 2011-05-18 | |||
| 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 | |||
| page last uploaded: 23 November 2011, 19:49 |