The dir has too many options. When excel reads the date it put the data into
multiple cells. This works better
dir %1 /b /o:n "%temp%\Listing.csv"
"Joel" wrote:
Gord: What do you think of this change to your code?
@echo off
dir %1 /-p /o:gn "%temp%\Listing.csv"
start excel "%temp%\Listing.csv"
del "%temp%\Listing.csv"
exit
"Gord Dibben" wrote:
Several methods to accomplish this.......I like Tushar's best if importing to
Excel.
To add a "Print Directory" feature to Explorer, go to
this KB Article.
http://support.microsoft.com/default...EN-US;q272623&
Or you can download Printfolder 1.2 from.....
http://no-nonsense-software.com/freeware/
I use PF 1.2 and find it to be more than adequate with custom
features.
OR Go to Command prompt and chdir to the folder with the files
Type DIR MYFILES.TXT
All the above create a *.TXT file which can be opened in Notepad and printed.
One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.
http://www.tushar-mehta.com/ scroll down to Add-insDirectory
Listing.
Download the ZIP file and un-zip to your Office\Library folder.
Gord Dibben MS Excel MVP
On Sat, 12 Apr 2008 19:02:00 -0700, davydahl
wrote:
I want to print a list of music files that I have in a folder on my hard
drive. How do I import only the file names into excel?