Writing directory contents to a text file?

I need to grab the file names from particular directory and have them written to a text file. I know I’ve done this with Perl before, but here at work we don’t have access to the command prompt and my Perl scripts won’t run. Given those limitations, is there another way to do this?

How about writing a batch file?

dir >> dir.txt

Messy, but gives you something to work with…

I can’t get batch files to run–anything that tries to open the command prompt at my office won’t work.

Uh… that’s a tricky one.
Only thing I could think of would be pulling up a window, snapshotting, then running an OCR app against the resulting JPEG.
Can you install cygwin and use that prompt?

I’ve never used cygwin before, so I’m not really sure. Probably not—I don’t have admin rights and most stuff won’t let me install it here.

The are programs that will do this, but I’m guessing you don’t have the rights to install apps on this machine?

In the unlikely event that you do…


Hmmm… If you’re familiar with vb script, I suppose you could try using that from within word or excel?

Display the directory in your browser.
Save it as a text file.

Drag and drop works for disks/directories in Firefox/Mac.
Automate it all with Applescript.

I was able to get PrintFolders to run…thanks! You guys just saved me a whole lot of manual work.