ms dos - list names in folder, do action and go back to folder in batch -


im facing following:

i have folder many folders named p_1400 p1_1499 (a hundred folders)

i want script access each folder , perform action

lets say:

>cd folder 1  >echo hello in file.txt  >cd ..  >cd folder 2 >echo hello in file.txt  >cd .. 

etc.. till theres no nore folders

little constriant folder missed lets p_1450 missing , folder named p_1420_1 or p_1420_2

thank help!

read help for , help pushd , try this

for /d %%a in (p_*) (    pushd %%a    echo action in %%a    popd %%a ) 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -