News Archives 2024 Q2
2024-06-10
• An error in
DelTrash.exe has been fixed: in verbose mode, specified drives will now be listed correctly.
2024-06-07
•
Pages2Txt.bat is a new batch file using OCR to extract text from a *.pages document.
It requires
7-zip as well as
Tesseract OCR and optionally MS Word.
Caveat: it will work on most single-page documents, but probably not on multi-page documents (not tested).
2024-06-01
•
DelTrash.exe has been updated:
- if a drive is specified in verbose mode, it will no longer list all drives.
- if a listed drive contains only 1 file of 129 bytes, there is nothing to delete from that drive, and it will be ignored
2024-05-27
•
lens.bat is a new batch file using
PHP to read an image's EXIF lens data.
2024-05-16
•
GetDimensions.exe is a new command line tool to read the dimensions of any type of image that is recognized in Windows Explorer.
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-07-31; loaded in 0.0024 seconds