![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | redirect unicode format output from powershell windows I entered this command: cmd /c "dir > $env:temp\xxx.txt" the output file xxx.txt is in ascii format. But if I entered this command instead: cmd /c dir > $env:temp\xxx.txt (without double quote) xxx.txt is in unicode format. Can someone give me an explanation? Thanks. |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: redirect unicode format output "hn" <hn@discussions.microsoft.com> wrote: > cmd /c "dir > $env:temp\xxx.txt" > cmd /c dir > $env:temp\xxx.txt My guess is that: *) in the first case redirection to a file is done by cmd (i.e. PowerShell runs cmd; cmd runs dir and redirects its output to a file in ASCII encoding, then PowerShell does nothing having no cmd output); *) in the second case redirection to a file is done by PowerShell (i.e. PowerShell runs cmd; cmd runs dir and sends output to the standard output stream, then PowerShell redirects this cmd output to a file in Unicode encoding). -- Thanks, Roman |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I redirect output from Invoke-Expression ? | David Kriz | PowerShell | 3 | 05-30-2008 09:53 PM |
| Re: -f output to file is unicode | Oisin Grehan | PowerShell | 0 | 12-11-2007 09:08 AM |
| Better HTML-ized output to file unicode/ascii thing | cccstar | PowerShell | 1 | 12-20-2006 11:59 AM |
| ansi versus unicode output with redirection operators? | klumsy@xtra.co.nz | PowerShell | 10 | 12-02-2006 11:25 PM |
| how to redirect whatif output to a file? | gaindev | PowerShell | 11 | 10-11-2006 12:57 PM |