Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the bat code that classifies the files in the directory by extension

Shulou Source: shulou.com Published: 2022-06-03 08:27:45 11月15日 Update

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!

Tags: Extensions files code articles directories categories content powerful not much commands most that is more knowledge industry information information channels channels references learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL Microsoft Linux Docker