C++:
#include <Windows.h>
#include <iostream>
void file_lister(std::wstring folder)
{
std::wstring folder_path = folder + L"\\*";
WIN32_FIND_DATA fd;
HANDLE handle = FindFirstFile(folder_path.c_str(), &fd);
if (handle == INVALID_HANDLE_VALUE)
return;
while (FindNextFile(handle, &fd)){
if (wcscmp(fd.cFileName, L".") == 0 || wcscmp(fd.cFileName, L"..") == 0)
continue;
std::wstring path = folder + L"\\" + std::wstring(fd.cFileName);
std::wcout << path << std::endl;
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
file_lister(path);
}
}
FindClose(handle);
}
int main() {
file_lister(L"C:\\Users");
return 0;
}