Gibberish when redirecting dir to txt file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
drgt
Posts: 160
Joined: 21 Sep 2010 02:22
Location: Greece

Gibberish when redirecting dir to txt file

#1 Post by drgt » 23 Apr 2011 07:32

xp sp2.

Command Line:

Code: Select all

Z:\Kids>dir *.mp3 /s /b
Z:\Kids\BebeLili\bebecd\Κομμάτι 1.mp3
Z:\Kids\BebeLili\bebecd\Κομμάτι 2.mp3
Z:\Kids\BebeLili\bebecd\Κομμάτι 3.mp3
Z:\Kids\BebeLili\bebecd\Κομμάτι 4.mp3


Test.txt file:

Code: Select all

Z:\Kids\BebeLili\bebecd\‰¦££α«  1.mp3
Z:\Kids\BebeLili\bebecd\‰¦££α«  2.mp3
Z:\Kids\BebeLili\bebecd\‰¦££α«  3.mp3
Z:\Kids\BebeLili\bebecd\‰¦££α«  4.mp3


This happens on files whose names are not in english, greek in this case.
I checked regional settings in control panel, they are set for Greek.

Any suggestions?
Thanks

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: Gibberish when redirecting dir to txt file

#2 Post by !k » 23 Apr 2011 18:01

Use unicode output

Code: Select all

cmd /u /c dir *.mp3 /s /b > Test.txt

or change codepage to Greek

Code: Select all

chcp 1253
dir *.mp3 /s /b > Test.txt

drgt
Posts: 160
Joined: 21 Sep 2010 02:22
Location: Greece

Gibberish when redirecting dir to txt file

#3 Post by drgt » 23 Apr 2011 23:52

Thank you !!!!!

Post Reply