Reputation: 41
What I want to accomplish can be done with for %%i in (*) do md "%%~ni"
however this only works if my batch file is in the same folder as the files I want to process. I want to run a batch file from a another folder.
This is what I have tried so far and it's not working. It is still creating the folders in the same folder I run the batch file.
for %%i in ("D:\test1\*") do md "D:\test2\" "%%~ni"
What am I doing wrong? I have not written a script before.
Upvotes: 0
Views: 1798
Reputation: 452
You need to concatenate the path with the name like this
for %%i in ("D:\test1\*") do md "D:\test2\%%~ni"
Upvotes: 2