I have folders with several files. What I want to do is to use the filenames of those files as the names of folders that woud be created within the same directory:

Screenshot of file names and folder name

How can I get the string data_1a from data_1a.txt and automatically batch create a new folder using that name (like the data_1a folder)?

  • Superuser is not a free script writing service though, you should provide what you have tried already and show that you have already put research into what you are trying to do. – El8dN8 Nov 28 '17 at 7:38

You could do:

forfiles /M *.txt /C "cmd /c if not exist @fname\ md @fname"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.