ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

How to use Command Prompt to Create a List of All The Files and Folders in a Computer

Updated on September 9, 2012


Here is a quick way to create a list of all files and folders, including files and folders in subdirectories and hidden files and folders, in a computer. The first thing you need to do is open up command prompt. In Windows XP, press start, then click run. Then type in CMD. In Windows 7, press start then type CMD.

A black window will open. This is the command prompt. Before Windows existed, computer users used what we called DOS or disk operating system. Command prompt is a program in the Windows operating system that works like DOS.

Now to create that list, first type in the drive letter then, add a colon. So, if you want to list all files and folders in drive D, then you should type “d:” without the quotation marks. Hit enter. If you want to list the files and folders in the drive letter Windows uses, you only need to type “cd..” and enter twice. By default, command prompt starts in the documents directory. “CD..” moves the command prompt pointers to the upper directory.

Now that you are in the right directory you can list all files and folders by typing “attrib /s /d” and then hit enter. Command prompt lists all the files and folders including those that are hidden but of course you want this to be saved. So you need to tell Command Prompt to save the list you do this with the . “>” command. Suppose you want to save the list in a file called log.txt, you need to type:

attrib /s /d > log.txt

You will now see that in the directory where you ran the attrib command that there is a new log.txt file open this and you will see the list of files and folders including their attributes. The attributes are written as letters, A for archive, S for system, H for hidden and R for read only.

Note that you can also list files and subfolders in a folder by changing the directory the Command Prompt points to by using the “cd” command.

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.

    Click to Rate This Article