I want to back up my file names, not my files
March 15, 2013 5:22 AM   Subscribe

I need a utility or a script that will generate a text file containing the names of all the subfolders and files in the the folders I specify.

I have automated full backups for all the important files on my computer. However, there are some folders that aren't worth backing up -- mostly music and videos that I've ripped from my own discs, copied from friends, or downloaded at some point or other. It wouldn't be a great loss if they were lost, but if so I'd like to know what I had lost so I can re-rip, buy or redownload the things I miss.

So I really just need something to generate something like a CSV file or just a easily-readable text file containing, hierarchically, all the subfolders and files in the folders I specify. I'd backup the resulting text file.

Google has failed me. Any suggestions? This is for a Windows 7 PC, but I should be able to do this from my Mac over the network if necessary.
posted by snarfois to Computers & Internet (11 answers total) 1 user marked this as a favorite
Best answer: Maybe you could redirect the output of TREE to a file? Assuming TREE is still supported. Something like:

TREE c:\path\to\my\files /F > files.txt
posted by RonButNotStupid at 5:28 AM on March 15, 2013 [1 favorite]

This is something most easily done from the command line. Are you familiar with the command line?
posted by yclipse at 5:33 AM on March 15, 2013

Best answer: Why not just use "dir /s [directory path] > filename.txt" ?
posted by ceribus peribus at 5:33 AM on March 15, 2013 [1 favorite]

dir /s >files.txt
posted by pompomtom at 5:34 AM on March 15, 2013 [1 favorite]

Response by poster: I know a small subset of both the DOS and Unix command lines, but never knew the switches for full subfolder contents. Both tree and dir /s do the trick, albeit differently. Thanks!

Tree's output includes special characters for the tree structure that display correctly in the DOS terminal, but not in my text editors. It's still readable, but doesn't quite look as intended.
posted by snarfois at 5:44 AM on March 15, 2013

For CLI access from your mac, you might consider installing OpenSSH on your Windows7 box. This would give you secure access from your Mac via ssh, and then you could run the dir commands and whatnot. If you are handy with scripting, I'd bet you could schedule that directory-listing job and then just pull it over from the Mac via scp. You could schedule that as well.
posted by jquinby at 5:46 AM on March 15, 2013

In your text editor, just put everything in a fixed-width font (e.g. Courier) and it should make more sense.
posted by emilyw at 5:49 AM on March 15, 2013

If you don't care about the date, size and summaries, you can add /b to get the "bare" format: dir /s/b directory > file

For future reference, on the Windows command prompt, you can type help to get a listing of all the usual commands, and help command to get help on a particular command. command /? (e.g. dir /?) will also give you the same info.
posted by Monday, stony Monday at 6:21 AM on March 15, 2013 [1 favorite]

Some utilities are listed here. (Karen's Directory Printer is great, but only on a windows XP system, since Karen died there won't be updates)
posted by Sophont at 8:58 AM on March 15, 2013

Make a batch file and paste this:

erase "%temp%\dir.txt" /q /f /ah
dir "[YOUR DIRECTORY HERE]" /A:-D /B /S > "%temp%\dir.txt"

Replace [YOUR DIRECTORY HERE] with the target directory. You can mess with the flags on line 2 to customize the output; as is it will generate a list of all files in a given directory and its subdirectories.
posted by jmfitch at 2:15 PM on March 15, 2013

In windows, I open the folder in Firefox or any non-IE browser. Copy and paste to text. This is assuming you don't need a list of files in each subfolder, but only the files in the main folder.
The easiest way to open the folder in a browser is to paste the path into the address bar: C:\Users\soelo\Downloads for example
posted by soelo at 6:33 PM on March 15, 2013

« Older Sydney reading coffee venue   |   Digital Electronics: Keeping a logic level high... Newer »
This thread is closed to new comments.