本帖最后由 zxar520 于 2022-9-6 14:21 编辑
- @echo off
- cd /d "%~dp0"
- for /f "delims=" %%A in (name.txt) do (
- md "wwwroot\%%~A" 2>nul
- xcopy "aaaa_cc\*" "wwwroot\%%~A" /e /f /y
- powershell -c "[io.file]::WriteAllText('home/wwwroot/%%~A/js/.user.ini',[io.file]::ReadAllText('home/wwwroot/%%~A/js/.user.ini').Replace('/aaa_cc/','/%%~A/'))"
- )
- pause
复制代码 大佬,我修改了下,现在可以复制了,但是不能修改文件内容,提示以下错误- 使用“1”个参数调用“ReadAllText”时发生异常:“未能找到路径“D:\Desktop\home\ho
- me\wwwroot\abc1_cc\js\.user.ini”的一部分。”
- 所在位置 行:1 字符: 85
- + [io.file]::WriteAllText('home/wwwroot/abc1_cc/js/.user.ini',[io.file]::Read
- AllText <<<< ('home/wwwroot/abc1_cc/js/.user.ini').Replace('/aaa_cc/','/abc1_cc/'))
- + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
- + FullyQualifiedErrorId : DotNetMethodException
复制代码
|