Get Sub-Directories
#include "stdafx.h" using namespace System; using namespace System::IO; using namespace System::Text; int main(array<System::String ^> ^args) { DirectoryInfo ^dir = gcnew DirectoryInfo("c:\\"); array<DirectoryInfo^>^ subDirs = dir->GetDirectories(); if (subDirs->Length == 0) Console::WriteLine("\tNone."); else { for each (DirectoryInfo^ dinfo in subDirs) { Console::WriteLine("\t{0}", dinfo->Name); } } return 0; }