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...
  • 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...
  • Keyboard shortcut of the week: Alternative windows hopping
    In a previous post I mentioned that you can hop between open windows by holding down the Alt key and pressing the Tab key repeatedly. A li...
  • Keyboard shortcut of the week: jump up a level
    When you are using Windows Explorer - the file management program that opens when you double-click on 'My Computer' and the like - y...
  • Keyboard shortcut of the week: a view of Word
    There are a number of ways in which you can view a document in MS Word. You can switch between these different layouts by selecting them fr...
  • Keyboard shortcut of the week: align, centre and justify
    By default, all text in Microsoft Word is aligned to the left (except if the default language is set to Arabic or another script that reads ...
  • Keyboard shortcut of the week: don`t bin it, delete it
    Whenever you delete a file it will be sent to the Recycle Bin so that it can be restored if you change you mind (unless the file is too lar...
  • Updates
    Apologies for not posting anything recently. I have been very busy with the start of the new university year. Since things have calmed down ...
  • Keyboard shortcut of the week: Explorer
    A short and sweet post today, after so many lengthy ones. Here is a shortcut that I have mentioned in passing before: to open Windows Explor...
  • Keyboard shortcut of the week: Quickly Open Link in New Tab
    This tip should be of interest to all the Entrecard chain-droppers out there (you know who you are). It works in Internet Explorer (version...

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