No, you got fooledpenpen wrote:Under Win XP the \r characters were all ignored/removed when using with "for/F (string)":test.bat in hex wrote:40 65 63 68 6F 20 6F 66 66 0D 0A 66 6F 72 20 2F 46 20 22 64 65 6C 69 6D 73 3D 22 20 25 25 61 20 69 6E 20 28 22 0D 30 0D 31 0D 32 0D 33 0D 22 29 20 64 6F 20 65 63 68 6F 20 40 25 25 61 80 0D 0Atest.bat using c style escape characters wrote:@echo off
setlocal enableDelayedExpansion
for /F "delims=" %%a in ("\r0\r1\r2\r3\r") do echo @%%a€Code: Select all
Z:\>test
@0123Ç
![Wink :wink:](./images/smilies/icon_wink.gif)
The \r characters were stripped in phase 1.5 of the normal batch parser. In your script it has nothing to do with FOR /F.
Even on XP, FOR /F does not strip all \r from input - it only strips the very last character (before \n) if it happens to be \r. All other \r are preserved. The safe return technique would not work if this were not the case.
You can prove this by having FOR /F read a file containing a line that looks like "\r0\r1\r2\r3\r\r\n". Another option is to get that string into a variable, and then use FOR /F with IN("!var!").
Dave Benham