Hi Steffen, Brilliant workaround for ensuring Unicode I/O. 8) But please explain this line: for /f "tokens=2,6 delims={:," %%a in ('type "foo.tmp~"') do echo %%a*%%b Why all the tokens and delims, and why the asterisk between %%a and %%b? And why use TYPE inside the in (...) clause of the for /f loo...
Hello All! :) Slightly off topic, but I thought some of you DOS veterans might be interested in this. SF author Robert J Sawyer has put together a WordStar archive . For those of you who don’t know, WordStar was a much loved word processor that predates Word and even Windows itself. The archive incl...
Hi Shodan! :) This has been on my to-do list for a long time. Your post finally spurred me into action. Searching the web yielded nothing. There are plenty of range generators, but no code examples. No matter, a straightforward problem… or so I thought until I tried to write the program. It proved t...
Very ambitious! But what is your use-case? And why are you re-inventing the wheel? Just pass the string to JScript or PowerShell in an environment variable, let it chop up the string any way you want, and capture the output in an for /f loop.
Hi Shodan, There should indeed be a terminating endLocal somewhere after the end of the for /f loop. Delayed expansion is explicitly disabled to prevent any ^ and ! characters in the line of input from being corrupted. But once the line has been read into the variable, delayed expansion can be safel...
Hello All! :) A little proof-of-concept program I put together: @echo off & setLocal enableExtensions disableDelayedExpansion (call;) %= sets errorLevel to 0 =% for /f "tokens=*" %%A in ('chcp') do for %%B in (%%A) do set "cp=%%~nB" mode con cp select=437 >nul ((for /l %%I in (1 1 70) do pause) >nul...