Zend certified PHP/Magento developer

How to execute a command for each of the sub folders?

I have the following structure:

parent_folder
     |______subfolder1
     |           |________sub_subfolder_1
     |           |________sub_subfolder_2
     |           |________sub_subfolder_3
     |          
     |______subfolder2
                 |________sub_subfolder_4
                 |________sub_subfolder_5
                 |________sub_subfolder_6

I need to be able to execute certain command on each of the sub_subfolder_x‘s

For my example I just try to echo the folders names.

this is what I tried but it doesn’t work:

for /d %%x in (*) do (
cd %%x
for /d %%y in (*/%%x) do (
echo %%y
)
)

When I simply do

for /d %%x in (*) do (
echo %%x
)

it works and lists all the folders under the parent_folder. But my script that tries to cd to (*/%%x) doesn’t work