Find and open a subfolder (using 'for' and 'start')
Posted: 21 May 2020 15:44
Hello,
I'd like to find and open subfolder by name.
I have the simple command line
That is, find (all) folders which have the word "amazon", but not with "bak" (e.g. I want "c:\mine\amazon" but not "c:\mine\amazon\bak" )
Then, I'd like to pipe this to start command and open folders.
How can I create a batch file that takes "amazon" as argument and opens the folders?
Something like findfolder.bat:
Thank you,
-Steph
I'd like to find and open subfolder by name.
I have the simple command line
Code: Select all
dir /a:d /s /b |find "amazon" |find /v "bak"
Then, I'd like to pipe this to start command and open folders.
How can I create a batch file that takes "amazon" as argument and opens the folders?
Something like findfolder.bat:
Code: Select all
for %%a in (dir /a:d /s /b |find "%~1" |find /v "bak") do start "" "%%~a"
-Steph