Com o c # use algo assim para começar:
string[] saFilelist = Directory.GetFiles(@"A:\A");
int iNumOfFoldersToCreate = saFilelist.Length/256;
for(int i = 0; i<iNumOfFoldersToCreate ; i++)
{
string sCurrentDir = @"A:\A" + i.ToString();
Directory.CreateDirectory(sCurrentDir );
for(int j = 0; j<256 ; j++)
{
File.Move(saFilelist[i*256+j], sCurrentDir + "\" + Path.GetFileName(saFilelist[i*256+j]));
}
}