本帖最后由 qixiaobin0715 于 2023-6-2 14:59 编辑
- @echo off
- setlocal enabledelayedexpansion
- set "SourcePath=C:\1\s"
- set "DestPath=D:\abc"
- for /f "delims=" %%i in (1.txt) do (
- if not "%%~xi"=="" (
- set "str=%%~dpi"
- set "str=!str:%SourcePath%=%DestPath%!"
- if not exist "!str!" md "!str!"
- copy "%%i" "!str!\"
- )
- )
- pause
复制代码
|