![]() |
File count |
Post Reply ![]() |
Author | |
mosenkum ![]() Groupie ![]() Joined: 09 July 2008 Location: India Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() Posted: 11 July 2008 at 1:18am |
how to count number of files
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
1 + 1 = 2
2 + 1 = 3
and so on...
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
mosenkum ![]() Groupie ![]() Joined: 09 July 2008 Location: India Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
I am not able to get you.
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
it was joke.
Use this formula:
number of files = (number of file and directories) - (number of directories)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
mosenkum ![]() Groupie ![]() Joined: 09 July 2008 Location: India Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
How i can get no files and dir?
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Oleg you made a mistake, if you substract the number of directories you will have a major error and VB IDE will crash
![]() ![]() Thanks
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, try to ask question right - what exactly you need? Number of files in some directory/whole disk/ etc.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
mosenkum ![]() Groupie ![]() Joined: 09 July 2008 Location: India Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
Number of files in some directory
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Here some code
Set fso = CreateObject("Scripting.FileSystemObject")
' Get Folders collection. Set oFolders = fso.GetFolder(Root) Set oFiles = oFolders.Files
For Each oFile In oFiles Debug.Print oFile.Name
Next for details see in MSDN FileSystemObject
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Baldur ![]() Senior Member ![]() Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
![]() ![]() ![]() ![]() ![]() |
Check directly for oFiles.Count if you don't need the names.
|
|
![]() |
|
mosenkum ![]() Groupie ![]() Joined: 09 July 2008 Location: India Status: Offline Points: 25 |
![]() ![]() ![]() ![]() ![]() |
How to use the code in vc++
|
|
![]() |
|
Baldur ![]() Senior Member ![]() Joined: 22 November 2006 Location: Germany Status: Offline Points: 244 |
![]() ![]() ![]() ![]() ![]() |
In C++ its easy, you can use the functions:
FindFirstFile()
FindNextFile()
FindClose()
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |