News Page
On this page I'll report on changes to my web site or related news items.
Don't expect a full-blown weblog, more like a list of highlights in shorthand.
For a file based list of changes look at the What's New list.
2024-04-21
2024-04-20
•
Easter.bat has been updated:
- it now uses REG.EXE (version 3 or later) instead of REGEDIT
- as a result, it no longer requires elevated privileges
- and as a consequence it no longer works in Windows NT 4 or 2000
- the JDate (Julian Date) function has been updated so it won't crash on leading zeroes
2024-04-16
• Oops, looks like
CompareVersions.bat had been simplified too much:
- return code would always equal 0 => fixed
- zero digits were ignored (e.g. 10.0.1 would be treated as 10.1) => fixed
- if versions were equal the batch file name would be displayed instead of the highest version => fixed
2024-04-15
•
CompareVersions.bat has been rewritten and simplified.
Warning: return codes in the new version 2.00 have changed!
2024-04-09
•
Yesterday.bat has been updated, after Daniele Zanotti reported that its JDate function failed on leading zeroes.
I corrected the error, and will be investigating other batch files as well, as I seem to remember this function was used more than once...
Thanks Daniele
• An error was reported in the
Batch HowTo Verify if variables are defined page:
The following code, which works in batch files for all MS-DOS, Windows and OS/2 versions, uses an alternative way to show if a variable is defined or not:
IF "%MyVar%"=="" (ECHO MyVar is NOT defined) ELSE (ECHO MyVar IS defined)
Oops! This is not true, of course, MS-DOS and OS/2 batch interpreters don't support parentheses, nor
IF ... ELSE
!
The following 2 lines of code
are compatible with all batch interpreters, provided
%MyVar%
itself does not contain doublequotes:
IF "%MyVar%"=="" ECHO MyVar is NOT defined
IF NOT "%MyVar%"=="" ECHO MyVar IS defined
• While browsing my directory of batch files I noticed
Obscure.bat, a 20 years old demo batch file demonstrating how URLs can be made to look completely different.
This batch file converted an IPv4 address into a decimal number, but due to 32-bit integer limitations it had to prompt for some manual editing for IP addresses starting with 128 or higher.
It suddenly occurred to me that I might as well try using a hexadecimal number instead of decimal, which can be "computed" without integer math (e.g. 128.10.0.255 can be represented as 0x800A00FF: 128=0x80, 10=0x0A, 0=0x00, 255=0xFF).
This worked for pinging a host — but thank goodness these days the web is protected against abusing this trick, by browser security as well as by content delivery networks like CloudFlare.
Archived News
page last modified: 2024-04-21; loaded in 0.0066 seconds