How to realize the bat code that classifies the files in the directory by extension
Editor to share with you how to achieve the directory files by extension classification of the bat code, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!
In fact, it is realized by using the powerful for command.
Implementation code:
For% I in (*) do (md% ~ ximove *% ~ xi%% ~ xi) pause%~xI-extend% I to a file extension only FOR / F "delims=="% I IN ('dir / b') DO @ echo% ~ xipause above is all the contents of this article entitled "how to classify files in a directory by extension". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!