Jump to content
Sign in to follow this  
DVDRW

Count number of files in certain folder

Recommended Posts

DVDRW

Cant find function for that. What is the simplest way to do this. :)

Share this post


Link to post
Share on other sites
d4rk

$search = FileFindFirstFile("*.*")  
If $search = -1 Then
   MsgBox(0, "Error", "No files/directories matched the search pattern")
   Exit
EndIf

$files=0
While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    $files=$files+1

WEnd
MsgBox(64,"","We got total : "& $files & " files")


FileClose($search)


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
Jos

Faster alternative:

$size   = DirGetSize(@WindowsDir,3)
If IsArray($size) Then
    Msgbox(0,"DirGetSize-Info","Size(Bytes):" & $size[0] & @LF _
        & "Files:" & $size[1] & @LF & "Dirs:" & $size[2])
EndIf
Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
DVDRW

$files = DirGetSize ( "c:\",1)
MsgBox(0,"",$files[1])

:)

Thanks for quick reply

Edited by DVDRW

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×