Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I count files in a specific directory?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi!

I want to count and get the names of files in a dir I specify?

how can I do this?


Suffix
 
Hi,

a general method is starting with a command like:

DIR *.* > DIR.OUT

After that you read the file "DIR.OUT" as a text file.

It depends on what environment you are running what you get. For example with Windows NT you can do:

DIR *.* /X > DIR.OUT

and you get the long names and the short names.

To find out what your operating system can do, you can give the command

DIR /?

Some compilers have special routines for you to get the filenames in a general way. For example CA-REALIA has a DOS level interface.

I hope this helps you. :)

Regards,

Crox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top