How to realize batch independent compression and decompression of directories by batch bat+Rar
Editor to share with you how batch bat+Rar to achieve batch independent compression and decompression of directories, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
C:\ r\ a
C:\ r\ b
Cd c:\ r
Compress each directory independently
The code is as follows:
For / d% an in (*) do C:\ Progra~1\ WINRAR\ RAR.EXE a-k-r-s-M1% a.rar% a
The result is:
C:\ r\ a.rar
C:\ r\ b.rar
Decompress each catalog independently
The code is as follows:
For% an in (* .rar) do C:\ Progra~1\ WINRAR\ RAR.EXE x-y% a
The result is:
A.rar to a directory
B.rar to the b directory
These are all the contents of this article entitled "how batch bat+Rar achieves batch independent compression and decompression of directories". 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!