Friday, July 13, 2007

Quick Command Line Tip - for XP users no less

I'm always eager to shout about the benefits of the command line to whoever will listen, even if it's XP.

I had a colleague here ask me about how to get a printed out listing of files in a given directory. He was told by a friend that he could use MS-Paint to...

whoa whoa whoa.. I stopped him in his tracks. I'm sure MS-Paint is a solution for something (doubtful, but maybe), however printing out directory listings is definitely NOT it!

I showed him how, by opening up the XP command line, you could navigate to the folder in question and then just do:

dir > filelist.txt

Which of course does the 'dir' command but puts the listing into a text file of your choosing instead of displaying it. The text file I argued, was infinitely more useful than a bmp image. The only downside I told him was having to navigate to the folder you want with a series of cd commands. I demonstrated the TAB completion that XP has in its console window to aid in this regard.

However, a quick google search yielded this page, which describes a few different methods of getting a 'Open Up Command Prompt Here..' function into your right-click context menu in Windows Explorer.

Very useful! ;)




2 comments:

Anonymous said...

ahh. i use this often here at work. however, so i do not have to navigate with he command line (which isn't that big of a deal), i wrote a simaple .bat file with "dir *.* /s /b /-p> directory_list.txt" inside. now just copy that .bat file to whatever folder that you want a directory list and execute the batch file. voila!

Anonymous said...

Kewl. Thanks for the link to that page--I've found a bunch of goodies!