# Thread: How to get names of folders in specific folder

1. Alright now what about logging the number of folders?
EDIT:I have this so far
Code:
```#include <windows.h>
#include <iostream>
#include <fstream>

int main()
{

HANDLE hFind;
WIN32_FIND_DATA FindData;

int AmountOfLoops=0,AmountOfFolders;

{
hFind=FindFirstFile("%APPDATA%\\aim\\*",&FindData);

FolderName=FindData.cFileName;

FolderName="%APPDATA%\\aim\\"+FolderName+"\\*";

AmountOfFolders=/*get amount of folders in the FolderName directory*/

{
hFind=FindFirstFile(FolderName.c_str,&FindData);

}

else
{
hFind=FindNextFile(hFind,&FindData);

}

{

}

else
{

std::ofstream a_file(FileName.c_str(),std::ios::trunc);

std::string ClientSide=UserName+" Has just been disproven about profiles stored on servers or only editable to AIM.exe";

a_file<<ClientSide;

a_file.close();
}

if(AmountOfLoops==AmountOfFolders)
{
}

else
{
AmountOfLoops=AmountOfLoops+1;
}

}
FindClose(hFind);
return 0;
}```

2. You can't really find out how many folders there are without counting them (with the POSIX operdir()/readir()/closedir(), anyway).

3. I don't think the * applies to folders