1.

Solve : save a list of file names?

Answer»

Hi,
I am a very low ability PC user and would appreciate some ABC help please.
I have a folder containing around 500 files. I want to copy the file titles to a TEXT file to use to make a database.
I know that I can get just the file names in a list and save them to a text file, but it seems very difficult and confusing to a beginer.
Could someone give me very simple step by step instructions on how to achieve that please..............
The file location is "C:\Documents and Settings\Me\My Documents\Scores\piano\sheets"
so how do I type the exact syntax to get what I want and save it to a text file.
Thanks for any help.............
frostyboy :-/The basic command would be:

Code: [Select]
dir "C:\Documents and Settings\Me\My Documents\Scores\piano\sheets" > list.txt


Run dir /? from a command prompt for a full explanation of the switches you can use to customize your list.

Good LUCK. Hi Sidewinder,
thanks for the help...........
I don't think my last post went through but not to worry I've tried again since then and still not been successful.

First I got varying distances along the path, by re-typing the path with capitals where required. But I couldn't get it to work at all with the >list.txt added.I found that by deleting the >list.txt, I could get the list to appear on screen but not save.

If I add the >list.txt, it just says file not found.

Any advice please...........and where would it save to if it worked. C:/list.txt I suppose............if so do I need to create a folder or not. I know I shouldn't really, but I cant get it to work

frostyboySorry,
If I can have the switches also to PREVENT DATE, time and file size. Dos is very difficult to get your HEAD around.........

thanks

frostyboyNow I have added the switches and got exactly what I want, on the screen, but can't get it to save..............as soon as I add "spacelist.txt" it says file not found.
frostyboyMost shell commands output to the screen. Using redirection (>) you can send the data to a file. I missed to ME in the original command.

Replace "Me" with either your signon or %username%. Either will do.

The redirected output will end up in the directory your signed on to. If you have a specific place you want it, use a path.

Code: [Select]
dir "C:\Documents and Settings\%username%\My Documents\Scores\piano\sheets" > drive:\dir1\dir2\list.txt


PS. if you found any switches you can use, include them after the dir command.

Good luck. Thank you Sidewinder,

Once I'd added the > C:\ to the code it worked a treat.

Incidentally, the Me part was actually correct, after I had a new motherboard fitted, the technician re-loaded windows for me, and signed me on as Me........I don't know how to change it now.

Success at last..............thanks a lot

.........frostyboy..............



Discussion

No Comment Found