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?
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?
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.
Summary: Since you posted in the dos forum, the dos command would be (at the C:\> prompt if you mean the root of C:); deltree/y *~1.* This will remove any files with a long filename, ~without~ a confirmation. ...