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.
我正在尝试创建一个批处理文件,它将文件从 d:\temp 复制到 c:\temp,如果文件已经存在于 c:\temp 上以实际从 c:\temp 中删除它,请不要尝试复制该文件文件并继续复制剩余的文件。如果存在则重复等。
干得好
for /r D:\temp %%a in (*) do ( if exist "C:\temp\%%~nxa" ( del "C:\temp\%%~nxa" /f /s /q ) else ( copy "%%a" C:\temp ) )