Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一项要求是通过命令提示符修改目录列表的名称。操作系统为 Windows Server 2008 R2。
示例 - 我确实有以下目录结构
我想通过批处理文件或命令提示符将上述目录结构更新为以下结构。
谁可以帮我这个事?
试试这个:
@echo off setlocal EnableDelayedExpansion for /r "C:\root" %%d in (.) do ( set dirname=%%~nxd echo !dirname! | findstr "#" >nul if !errorlevel! equ 0 ( set newname=!dirname:#=~! ren "%%~dpnd" "!newname!" ) ) endlocal