Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement the batch code renamed by the first two digits of a folder name

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

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!

Tags: Files codes folders articles names values information interests variables and at the same time abstracts times more friends titles formats directories knowledge editing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno Shulou Information MariaDB Redmi