Jump to content
Sign in to follow this  
Rahul Rohela

Count number of folders

Recommended Posts

Rahul Rohela


I am looking for script that give count of filders in given folder. Ouput is required in numbers equals to number of folders present in given path.



Share this post

Link to post
Share on other sites

Another way.............. change it as you wish..

$Path = @DeskTopdir

$search = FileFindFirstFile( $Path & "\*.*")


While 1

$file = FileFindNextFile($search)

If @error Then ExitLoop

if Stringinstr(FileGetAttrib($Path & "\" & $file),"D") then


$Total=$Total + 1




MsgBox(0,"","Total folders in " & $Path & " : " & $Total)

Edited by Rick
  • Like 1

Who needs puzzles when we have AutoIt!!

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.