0

Suppose I have the command:

:start
if /i "%%~fs"=="%drive%" cd %%~fs&md Favorites 2>nul
if /i "%%~fs"=="%drive%" cd %%~fs&md "Discography Info" 2>nul
...
goto start

How would I loop the command and each time put in a different name?

1 Answer 1

2

You can do it similar to this:

@echo off
for %%f in (*) do call :printit "%%f"
goto :end
:printit arg1
echo %~1 ---- %1
exit /b 0
:end
echo Done.
pause
Sign up to request clarification or add additional context in comments.

3 Comments

Can you loop the call :startx's as well? Or is that not possible?
This was actually very fun to try out and surprising in how user friendly it was, so thank you very much!
I'm not totally understanding your question. I think there is enough information in my answer for you to figure out a infinite loop. stackoverflow.com/questions/5487473/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.