Hex Conversion via a Batch File

Occasionally, when something bad happens, an application will return an exception code (which is occasionally an NTSTATUS value). Unfortunately dumping out %ERRORLEVEL% can give you a negative value which makes looking up the error a little harder. Since I was in batch-land, I had the desire to take the value and print it out in…

3

Batch File String Substitution with Nested Environment Variables

The SET command has some nice extensions that let you do various manipulation operations on environment variables. One said operation is the string substitution feature, which is often used to perform basic pattern replacements such as stripping out quotes around filenames:  set ABC=”c:\foo.txt”set ABC=%ABC:”=%echo %ABC% In the above sample, the quotes around the filename are…

2