Assuming the following directory structure exists under the current directory, and for-sk-w7.cmd is...
Code: Select all
@for /d %%d in (*) do dir /x "%%~d"
for /r %%k in (*) do @if not exist "%%~sk" echo "%%~sk" ---???--- "%%~fk"
Code: Select all
C:\tmp>for-sk-w7
C:\tmp>dir /x "19 €"
02/09/2013 11:39 PM 0 12345_~1.1 12345=7.1
02/09/2013 11:39 PM 0 1234_6~1.12 1234=6.12
02/09/2013 11:39 PM 0 123_5~1.123 123=5.123
02/09/2013 11:39 PM 0 12_4~1.123 12=4.1234
C:\tmp>dir /x "20 €"
02/09/2013 11:39 PM 0 12345_~1.1 12345=7.1 ***
02/09/2013 11:39 PM 0 1234_6~1.12 1234=6.12
02/09/2013 11:39 PM 0 123_5~1.123 123=5.123
02/09/2013 11:39 PM 0 12_4~1.123 12=4.1234 ***
C:\tmp>dir /x "21 €"
02/09/2013 11:39 PM 0 12345_~1.1 12345=7.1
02/09/2013 11:39 PM 0 1234_6~1.12 1234=6.12 ***
02/09/2013 11:39 PM 0 123_5~1.123 123=5.123 ***
02/09/2013 11:39 PM 0 12_4~1.123 12=4.1234
C:\tmp>dir /x "22 €"
02/09/2013 11:39 PM 0 12345_~1.1 12345=7.1
02/09/2013 11:39 PM 0 1234_6~1.12 1234=6.12
02/09/2013 11:39 PM 0 123_5~1.123 123=5.123
02/09/2013 11:39 PM 0 12_4~1.123 12=4.1234
C:\tmp>for /R %k in (*) do @if not exist "%~sk" echo "%~sk" ---???--- "%~fk"
"C:\tmp\202075~1\12345_~1.1 \12345=7.1" ---???--- "C:\tmp\20 €\12345=7.1"
"C:\tmp\202075~1\12_4~1.123 \12=4.1234" ---???--- "C:\tmp\20 €\12=4.1234"
"C:\tmp\21716B~1\1234_6~1.12 \1234=6.12" ---???--- "C:\tmp\21 €\1234=6.12"
"C:\tmp\21716B~1\123_5~1.123 \123=5.123" ---???--- "C:\tmp\21 €\123=5.123"
C:\tmp>
What displays as an extra space in the directory part of the failing pathnames above is actually a U+2000 "en quad" space. Don't see any pattern, nor have much of a clue as to what kind of bug could possibly cause it. Just thought I'd mention it here for the cmd fun collectors
Liviu