Print Page | Close Window

File count

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11389
Printed Date: 19 April 2025 at 9:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: File count
Posted By: mosenkum
Subject: File count
Date Posted: 11 July 2008 at 1:18am
how to count number of files



Replies:
Posted By: Aaron
Date Posted: 11 July 2008 at 2:13am
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....


Posted By: mosenkum
Date Posted: 11 July 2008 at 2:26am
I am not able to get you.


Posted By: Oleg
Date Posted: 11 July 2008 at 2:43am
it was joke.
 
Use this formula:
 
number of files = (number of file and directories) - (number of directories)


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mosenkum
Date Posted: 11 July 2008 at 2:59am

How i can get no files and dir?

 



Posted By: Aaron
Date Posted: 11 July 2008 at 3:45am
Hi,
 
Oleg you made a mistake, if you substract the number of directories you will have a major error and VB IDE will crash  Think you have to add some feature to have this fixed. I will write to support to fix this
 
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....


Posted By: Oleg
Date Posted: 11 July 2008 at 3:46am

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


Posted By: mosenkum
Date Posted: 11 July 2008 at 4:59am
Number of files in some directory


Posted By: Oleg
Date Posted: 11 July 2008 at 5:36am
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


Posted By: Baldur
Date Posted: 11 July 2008 at 7:24am
Check directly for oFiles.Count if you don't need the names.


Posted By: mosenkum
Date Posted: 11 July 2008 at 7:35am
How to use the code in vc++


Posted By: Baldur
Date Posted: 14 July 2008 at 3:28am
In C++ its easy, you can use the functions:
FindFirstFile()
FindNextFile()
FindClose()



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net