How to implement the batch code renamed by the first two digits of a folder name
This article mainly introduces how to achieve the folder name of the first two renamed batch code, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
A batch script that renames all folders with the first two digits of their names:
The code is as follows:
@ echo off& setlocal enableDelayedExpansion set n = 41029 for / f "delims="% an in ('dir / ad / b') do (set aura% a ren "%% a" 41029) Pause
Explanation of the above code:
Where / ad displays only directories, that is, strips out files, and only shows folders.
/ b is in an empty format (no title information or summary).
Use it when using variables!
Thank you for reading this article carefully. I hope the article "how to realize the first two renamed batch codes for folders" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!