generating "tree" directory listing, to file, with extended characters

J

Joe

Hi, I was hoping someone could help me.

I want to generate a file containing a tree directory listing of the
directories on my hard drive. When I execute the command 'tree' in XP, I get
the following:

C:\>tree c:\windows
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
????addins
????AppPatch
????ASYM
? ????RUNTIME
????Config
????Connection Wizard
????Cursors
????Debug
? ????UserMode
? ????WPD

The above contains extended characters (if not seen in this post). But the
extended characters are output in the DOS window. I instead want the above
information sent to a file. So I execute the following command:

C:\>tree c:\windows > win.txt
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
ÃÄÄÄaddins
ÃÄÄÄAppPatch
ÃÄÄÄASYM
³ ÀÄÄÄRUNTIME
ÃÄÄÄConfig
ÃÄÄÄConnection Wizard
ÃÄÄÄCursors
ÃÄÄÄDebug
³ ÃÄÄÄUserMode
³ ÀÄÄÄWPD

I get garbage characters instead within the file content. I have tried to
view the file within word and convert the encoding to DOS or some other
encoding, but I dont get the original extended characters. Would anyone know
how i can generate the original directory listing to a file without having
to copy the content of the DOS screen and pasting to a file?

Many thanks!

Joe.
 
R

Ramesh, MS-MVP

Joe,

Tree c:\windows /a >filename.txt

Type "Tree /?" for more info.

==================================
TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
==================================
 
J

Joe

Hi Ramesh,

yep i know about the /a flap. But I prefer having the extended characters
displayed instead. any other way?

thanks again!
Joe


Ramesh said:
Joe,

Tree c:\windows /a >filename.txt

Type "Tree /?" for more info.

==================================
TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
==================================

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Joe said:
Hi, I was hoping someone could help me.

I want to generate a file containing a tree directory listing of the
directories on my hard drive. When I execute the command 'tree' in XP, I
get the following:

C:\>tree c:\windows
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
????addins
????AppPatch
????ASYM
? ????RUNTIME
????Config
????Connection Wizard
????Cursors
????Debug
? ????UserMode
? ????WPD

The above contains extended characters (if not seen in this post). But
the extended characters are output in the DOS window. I instead want the
above information sent to a file. So I execute the following command:

C:\>tree c:\windows > win.txt
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
ÃÄÄÄaddins
ÃÄÄÄAppPatch
ÃÄÄÄASYM
³ ÀÄÄÄRUNTIME
ÃÄÄÄConfig
 
R

Ramesh, MS-MVP

Joe,

If you have MS Word, you can view the Extended characters in GUI.

Start Winword and open the txt file (with contains the extended chars).
When the File Conversion dialog appears, select a DOS encoding. Eg..Western
European(DOS)

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Joe said:
Hi Ramesh,

yep i know about the /a flap. But I prefer having the extended characters
displayed instead. any other way?

thanks again!
Joe


Ramesh said:
Joe,

Tree c:\windows /a >filename.txt

Type "Tree /?" for more info.

==================================
TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
==================================

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Joe said:
Hi, I was hoping someone could help me.

I want to generate a file containing a tree directory listing of the
directories on my hard drive. When I execute the command 'tree' in XP, I
get the following:

C:\>tree c:\windows
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
????addins
????AppPatch
????ASYM
? ????RUNTIME
????Config
????Connection Wizard
????Cursors
????Debug
? ????UserMode
? ????WPD

The above contains extended characters (if not seen in this post). But
the extended characters are output in the DOS window. I instead want the
above information sent to a file. So I execute the following command:

C:\>tree c:\windows > win.txt
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
ÃÄÄÄaddins
ÃÄÄÄAppPatch
ÃÄÄÄASYM
³ ÀÄÄÄRUNTIME
ÃÄÄÄConfig
 
J

Joe

Thanks Ramesh!

I initially tried this by doing a "tree > output.doc" and then opening the
doc file (and select the encoding within the conversion dialog box as you
said). I thought doing this (i.e. outputing to a .doc file) would preserve
the extended chars. It seemed to work initially, but then failed to work on
subsequent generated files. I guess I should do as you said and output to a
..txt file instead of a .doc file, and open the txt file from within word. It
seems to works consistently now. Thanks!

cheers,
Joe

Ramesh said:
Joe,

If you have MS Word, you can view the Extended characters in GUI.

Start Winword and open the txt file (with contains the extended chars).
When the File Conversion dialog appears, select a DOS encoding.
Eg..Western European(DOS)

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Joe said:
Hi Ramesh,

yep i know about the /a flap. But I prefer having the extended characters
displayed instead. any other way?

thanks again!
Joe


Ramesh said:
Joe,

Tree c:\windows /a >filename.txt

Type "Tree /?" for more info.

==================================
TREE [drive:][path] [/F] [/A]

/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
==================================

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Hi, I was hoping someone could help me.

I want to generate a file containing a tree directory listing of the
directories on my hard drive. When I execute the command 'tree' in XP,
I get the following:

C:\>tree c:\windows
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
????addins
????AppPatch
????ASYM
? ????RUNTIME
????Config
????Connection Wizard
????Cursors
????Debug
? ????UserMode
? ????WPD

The above contains extended characters (if not seen in this post). But
the extended characters are output in the DOS window. I instead want
the above information sent to a file. So I execute the following
command:

C:\>tree c:\windows > win.txt
Folder PATH listing
Volume serial number is 0480-36BC
C:\WINDOWS
ÃÄÄÄaddins
ÃÄÄÄAppPatch
ÃÄÄÄASYM
³ ÀÄÄÄRUNTIME
ÃÄÄÄConfig
 
R

Ramesh, MS-MVP

You're welcome Joe.

--
Ramesh, Microsoft MVP
Windows XP Shell/User
http://windowsxp.mvps.org


Joe said:
Thanks Ramesh!

I initially tried this by doing a "tree > output.doc" and then opening the
doc file (and select the encoding within the conversion dialog box as you
said). I thought doing this (i.e. outputing to a .doc file) would preserve
the extended chars. It seemed to work initially, but then failed to work
on subsequent generated files. I guess I should do as you said and output
to a .txt file instead of a .doc file, and open the txt file from within
word. It seems to works consistently now. Thanks!

cheers,
Joe

<snip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top