- @echo off
- cd /d "%~dp0"
-
- setlocal enabledelayedexpansion
-
- for /f "delims=" %%i in ('dir /b /a-d "*-*"') do (
- set "filename=%%i"
- for /f "tokens=1* delims=-" %%a in ("!filename!") do (
- set "folderName=%%a"
- if not exist "!folderName!" (
- md "!folderName!"
- )
- move "%%i" "!folderName!"
- )
- )
-
- endlocal
- pause
复制代码 这个是只保留特殊符号左边的名称作文件夹并移入 |