Computing.Net > Forums > Disk Operating System > dir>list.txt with long filenames?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

dir>list.txt with long filenames?

Reply to Message Icon

Name: Doyle Welborn
Date: October 30, 2003 at 20:12:09 Pacific
OS: WinXP
CPU/Ram: 2.13/256
Comment:

What is the command to print long filenames to a file from inside a batch file? In Win98 I used dir>list.txt and the long filenames were included automatically. Is there a command line switch I need to add for WinXP? The command "dir>list.txt" in a batch file (using WinXP's command.com) gives me the list without the long filenames, while the same command at the DOS prompt (WinXP's cmd.exe prompt) gives the long filename. How do I get the long filename in a batch file?



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: October 31, 2003 at 01:40:03 Pacific
Reply:

You have to use

Cmd /C "Dir > List.txt"

to invoke the NT-based command processor Cmd.exe and its internal commands.

However, if you run your batch from a shortcut, you may substitute %SystemRoot%\System32\Command.com /C with %SystemRoot%\System32\Cmd.exe /C followed by your batch name in the command line box of Properties/Program, so getting access to the full capabilities of the more powerfull XP processor without losing the (pseudo)DOS environment.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: dir>list.txt with long filenames?

copying files with long filenames www.computing.net/answers/dos/copying-files-with-long-filenames/4586.html

REPLACE.EXE with long filenames www.computing.net/answers/dos/replaceexe-with-long-filenames/255.html

remove long filename www.computing.net/answers/dos/remove-long-filename/14753.html