Figured it out. Must be a syntax issue. But you can avoid the situation. In my above example, I have a list of the folders denoted as 'b'.
You can much easier type this as the code
For[i = 1, i <= Length[b], i++,
SetDirectory[b[[i]]];
it works much easier.