Re: [OT] Using DIR (CMD) with redirection to a file
- Posted by znorq2 Oct 06, 2009
- 2471 views
UUps, this didn't come out like I wanted... :(
Fixed it for you. You can use the triple brackets {{{/}}} to print output literally.
-Greg
Ok, thanks Greg - but does that include the slash - "/"?
Hi znorq2,
In file names and commands Windows uses the OEM (DOS) encoding,
but in .txt and other text files the native Windows encoding.
In Russian OEM is cp866, Windows - cp1251.
I recode my DIR output from 866 to 1251 to read it in Notepad properly.
Or just use in Notepad the Terminal font.
Regards,
kinz
Hi kinz,
When opening the console, default code page is 850. According to this page sent to me earlier, 865 (Nordic) is probably the one I should change to before running the DIR command...
This is what I did;
- Created folder "æøåÆØÅ" under "c:\data\test".
- Opened console (cmd)
- Changed to "c:\data\test"
- Confirmed current code page 850 (using chcp w/o params.)
- chcp 865
- dir *.* /b > files.txt
- Opened "files.txt" using notepad.
- Changed to font to "Terminal".
Letters "æøåÆØÅ" are now visible.
I use Font "Lucida Console" / Script "Western" as a default (did a little research, and this is the default font/script setting for everybody..), and æøåÆØÅ is perfectly usable characters in this font. But, when æøåÆØÅ is routed through DIR's redirection, it becomes garbled. Apperantly, they have a different byte representation in Western script compared to OEM/DOS? If so, it seems I have to go through the file replacing it with the correct byte representation for "Lucidia Concole / Western", (which shouldn't really be a problem..)?
That said, I would have used Euphoria - and not Console/DIR, but I've got no idea how I can produce the information I'm after (with the exception of path/filename, ofcourse);
- Created date/time
- Created by
- Filename/path
Kenneth / ZNorQ