Displaying all the files of a folder

This is a discussion on Displaying all the files of a folder within the C++ Programming forums, part of the General Programming Boards category; Is there a way to display the names of all the files in a folder? So that I can list ...

  1. #1
    Unregistered
    Guest

    Displaying all the files of a folder

    Is there a way to display the names of all the files in a folder? So that I can list all the files for the user to see.

    I thought of doing

    system("dir/p");

    or whatever that dos command was, but that shows a bit too much information for the user, is there a way to make it look simpler?

    Paul

  2. #2
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    Sorry don't know.
    You can try dir /b to display the names without the heading information and summary.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Use the FindFirstFile() and FindNextFile() API functions to retrieve a list of files in a directory.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User Dual-Catfish's Avatar
    Join Date
    Sep 2001
    Posts
    802
    How about a combination of dir /p /b? It displayes all the files in a nice neat column.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading .dat files from a folder in current directory...
    By porsche911nfs in forum C++ Programming
    Replies: 7
    Last Post: 04-04-2009, 09:52 PM
  2. accessing all files in a folder.
    By pastitprogram in forum C++ Programming
    Replies: 15
    Last Post: 04-30-2008, 10:56 AM
  3. How To Make The Program Installed In Program Files Folder?
    By javacvb in forum Windows Programming
    Replies: 4
    Last Post: 11-05-2003, 04:33 PM
  4. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  5. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 08:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21