批处理把C:\jenkins\workspace\FVC2.8\C_GEELY_Platform_GEEA3.0@2改成C:\jenkins_history\workspace\FVC2.8\C_GEELY_Platform_GEEA3.0
时间: 2024-04-27 13:18:14 浏览: 25
你可以使用批处理来将路径从"C:\jenkins\workspace\FVC2.8\C_GEELY_Platform_GEEA3.0@2"更改为"C:\jenkins_history\workspace\FVC2.8\C_GEELY_Platform_GEEA3.0"。以下是一个示例批处理脚本:
```batch
@echo off
setlocal
set "oldPath=C:\jenkins\workspace\FVC2.8\C_GEELY_Platform_GEEA3.0@2"
set "newPath=C:\jenkins_history\workspace\FVC2.8\C_GEELY_Platform_GEEA3.0"
setlocal enabledelayedexpansion
for /r %%i in (*.*) do (
set "filePath=%%i"
set "newFilePath=!filePath:%oldPath%=%newPath%!"
if not "!filePath!"=="!newFilePath!" (
echo Moving "!filePath!" to "!newFilePath!"
move "!filePath!" "!newFilePath!"
)
)
echo Path updated successfully.
endlocal
```
这个批处理脚本会递归地遍历指定路径下的所有文件和文件夹,并将包含旧路径的文件移动到新路径下。请确保在运行脚本之前备份重要的文件,以防意外发生。