echo. with curious output
Posted: 31 Mar 2013 16:31
Hi, I have a curious output with the echo command in XP.
I have the following folders & files:
and this batch code:
and I got this curious output:
and with this code:
that normal output:
Does anybody know the reason for this different behaviour (echo "." vs. "(")?
I have the following folders & files:
Code: Select all
C:\TEST
├───folder1
│ file1.iso
│
├───folder10
│ file10.iso
│
├───folder2
│ file2.iso
│
├───folder3
│ file3.iso
│
├───folder4
│ file4.iso
│
├───folder5
│ file5.iso
│
├───folder6
│ file6.iso
│
├───folder7
│ file7.iso
│
├───folder8
│ file8.iso
│
└───folder9
file9.iso
and this batch code:
Code: Select all
@echo off &setlocal
for /r %%i in (*.iso) do for /f "delims=" %%j in ("%%~dpi.") do echo."%%~dpi%%~nj"
endlocal
and I got this curious output:
Code: Select all
"C:\TEST\folder1\folder1"
"C:\TEST\folder10\folder10"."C:\TEST\folder1\folder1"
"C:\TEST\folder2\folder2"."C:\TEST\folder1\folder1"
"C:\TEST\folder3\folder3"."C:\TEST\folder1\folder1"
"C:\TEST\folder4\folder4"."C:\TEST\folder1\folder1"
"C:\TEST\folder5\folder5"."C:\TEST\folder1\folder1"
"C:\TEST\folder6\folder6"."C:\TEST\folder1\folder1"
"C:\TEST\folder7\folder7"."C:\TEST\folder1\folder1"
"C:\TEST\folder8\folder8"."C:\TEST\folder1\folder1"
"C:\TEST\folder9\folder9"."C:\TEST\folder1\folder1"
and with this code:
Code: Select all
@echo off &setlocal
for /r %%i in (*.iso) do for /f "delims=" %%j in ("%%~dpi.") do echo("%%~dpi%%~nj"
endlocal
that normal output:
Code: Select all
"C:\TEST\folder1\folder1"
"C:\TEST\folder10\folder10"
"C:\TEST\folder2\folder2"
"C:\TEST\folder3\folder3"
"C:\TEST\folder4\folder4"
"C:\TEST\folder5\folder5"
"C:\TEST\folder6\folder6"
"C:\TEST\folder7\folder7"
"C:\TEST\folder8\folder8"
"C:\TEST\folder9\folder9"
Does anybody know the reason for this different behaviour (echo "." vs. "(")?