Bloody Computer

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 4 June 2008

How to save a list of files in a folder

Posted on 10:04 by Unknown
There are a number of programs available that will create a text file from a list of files in a folder, but here is a quick and easy way of doing the same using the Command Prompt.

Firstly, open up the Command Prompt (aka the MS-DOS Box). To do this either click on 'Run' in the 'Start' menu, or hold down the Windows key and press R (the Windows key is the one with the Windows logo on). In the box that opens type cmd, and either click the 'OK' button or press the Return key. The Command Prompt application should open, looking something like this.


Secondly, you will need to navigate to the folder which contains the files you wish to list. If it is on a different drive type the drive letter followed by colon (e.g. D:) and hit return. Then type cd (change directory) followed by the path of the folder, for example:

cd c:\documents and settings\owner\my documents


On some versions of Windows you only need to type part of the folder name and then press the Tab key and the Command Prompt will fill in the rest, e.g. type cd c:\docu and press Tab to change the command to cd c:\documents and settings.

If you do not know the full path of the folder, you can set Windows Explorer to show it in the address bar or title bar - one of my earlier posts explains how to do this (I would recommend showing the full bath in the address bar). You can copy the path from the address bar and paste it into the command prompt screen by clicking on its icon in the top left hand corner, which opens a drop down menu as shown below.


Once you have navigated to the right folder you can type the command to create a file list in that folder in the form of a text file that can be opened in notepad or your word processor.

Note: Windows Vista includes a feature where you can hold down the Shift key and right-click on the icon of the folder you wish to list the files contained within and select 'Open Command Window Here' from the menu that opens. I will be publishing a post soon which will provide instructions on how to add this feature to Windows XP.


Directory List Command

To create a list of all the files in the folder type dir /a-d /b > filelist.txt and press Return/Enter.

The command includes two switches, /a-d and /b. The first of these stops the dir command. from listing folders; the second prevents the command from showing the extra information you see if you just type dir and hit Return. If you wish the text file to have a different name change it from 'filelist' but remember to put '.txt' at the end so that Windows knows that it is a text file.

The dir command has a variety of other switches, the following command will list the names of all the mp3 files in the current folder and all the sub-folders that it contains:
dir *.mp3 /a-d /s /b > mp3filelist.txt

The *.mp3 part tells the command to only list files with that extension, and the /s sets it to list the files in sub-folders too. Note that the files in the sub-folders will be listed prefixed by the folder name, e.g. 'D:\soulseek\placebo - covers\01 Running up That Hill.mp3'.

If you have a particular requirement for a file list leave a comment on this post and I will look into it for you. Also, if anyone is interested in learning more about the various commands and programs available in the Command Prompt please leave a comment.

One last point, you can use > filename.txt to send the results of any command to a text file, which can be very useful if you have to pass information on to a technician.

Now you can impress your friends and co-workers with your 'old skool' techie skills.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Command Prompt, Windows GUI | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Keyboard shortcut of the week: undo and redo
    Just about every windows application has an 'undo' feature and most have a 'redo' feature. These are a lifesaver on those fr...
  • How to show unread messages in Gmail
    Apologies for not posting in a while. I thought that I would share this short and sweet post for those who want to list only unread messages...
  • Recovering text from Word documents (Part 1)
    If Microsoft Word runs into a problem with a file it usually offers a recover option when you open the program the next time. But sometimes...
  • Toolbars gone AWOL
    There is a bug in Windows XP that causes the toolbars in Internet Explorer and Windows Explorer (the thing that opens when you double-click ...
  • Keyboard shortcut of the week: The Case of MS Word
    When using a word processor it is quite common to forget that that the CapsLock key has been left on, or you might decide that a piece of t...
  • How to reboot Windows using the keyboard
    I was writing a post on how to reinstall the mouse using the keyboard when I realised that rebooting the PC using the keyboard would be a re...
  • Weekend Website: PortableApps.com
    I have not run this feature in ages, but I decided to bring it out of retirement to feature an excellent site: PortableApps.com . With the i...
  • Bring files back from the dead
    Even after you have deleted a file, and emptied the Recycle Bin, you may still be able to recover the file. This is because the data in the ...
  • Windows Folder Options Explained (Part 3)
    Continued from part 2... View Settings continued Hide protected operating system files (Recommended) This option is selected by default, to ...
  • Customising the Quick Access Toolbar
    In a recent post about adding buttons to the toolbars in Microsoft Office applications I pointed out that there is no way to add buttons t...

Categories

  • Audio
  • Backups
  • Blog Carnival
  • Blogging
  • CD-roms
  • Chrome
  • Command Prompt
  • Competition
  • Drives
  • DVD-roms
  • Email
  • Error Messages
  • Excel
  • Faster Windows
  • File Conversion
  • File Management
  • File Recovery
  • File Types
  • Firefox
  • Fonts
  • Freeware
  • Games
  • Graphics
  • Guest article
  • Internet Explorer
  • Jargon
  • Keyboard shortcut
  • LibreOffice
  • Linux
  • Lost document
  • Low drive space
  • Mouse
  • Networking
  • OpenOffice
  • PowerPoint
  • Printing
  • Protection
  • Purchases
  • Registry
  • Review
  • Scanning
  • Searching
  • Security
  • Startup
  • Upgrades
  • Video
  • Web feeds
  • Websites
  • Windows Crash
  • Windows Explained
  • Windows GUI
  • Windows Hangs
  • Word Processing

Blog Archive

  • ►  2012 (4)
    • ►  September (1)
    • ►  May (1)
    • ►  February (2)
  • ►  2011 (12)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (2)
    • ►  February (2)
    • ►  January (2)
  • ►  2010 (21)
    • ►  December (2)
    • ►  October (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  March (6)
    • ►  February (4)
    • ►  January (1)
  • ►  2009 (33)
    • ►  December (1)
    • ►  November (1)
    • ►  October (3)
    • ►  September (4)
    • ►  August (1)
    • ►  July (2)
    • ►  June (4)
    • ►  May (3)
    • ►  April (3)
    • ►  March (3)
    • ►  February (4)
    • ►  January (4)
  • ▼  2008 (82)
    • ►  December (2)
    • ►  November (4)
    • ►  October (3)
    • ►  September (5)
    • ►  August (4)
    • ►  July (4)
    • ▼  June (6)
      • The Sixth Carnival of Computer Help and Advice
      • Keyboard shortcut of the week: a few for Firefox
      • Firefox 3 Download Day two hours away
      • Command Window Here: Free MS PowerToy for XP
      • How to save a list of files in a folder
      • How to make Windows quicker: lose the fancy look
    • ►  May (7)
    • ►  April (10)
    • ►  March (10)
    • ►  February (14)
    • ►  January (13)
  • ►  2007 (47)
    • ►  December (5)
    • ►  November (6)
    • ►  October (16)
    • ►  September (12)
    • ►  August (8)
Powered by Blogger.

About Me

Unknown
View my complete profile