You could iterate over the folders.
The for
command can takes a list of folder names or wildcards.
@echo off
cd /d c:\users\all users\bond
for /d %%D in (FOLDER NAMES GO HERE) do (
pushd %%D
attrib +h *.*
popd
)
exit /b
If you need to process all the folders in the current directory, just put *
there:
...
for /d %%D in (*) do (
...
You could also not change to the parent directory but specify it in the for
loop instead (note the quotes around the mask):
@echo off
for /d %%D in ("c:\users\all users\bond\*") do (
...
Similarly, you could omit jumping in to and out of each subdirectory and instead specify the path in the attrib
command.
So, the above script could be rewritten like this:
@echo off
for /d %%D in ("c:\users\all users\bond\*") do attrib +h "%%D\*"
exit /b