开发者

Batch to filter out duplicates in separate directories

开发者 https://www.devze.com 2023-04-12 12:47 出处:网络
I have two folders two different locations with a bunch of automatically generated (generated through install and repair/ reset) files in them.

I have two folders two different locations with a bunch of automatically generated (generated through install and repair/ reset) files in them.

Occasionally what happens is that a file of a particular name and extension is found in both folders which causes errors in the associated program, the solution is to delete one of the two so only one remains.

I use batch at work mostly the novice xcopy and so on commands, how i开发者_如何学JAVAf can I achieve my desired result?


The OP wrote:

Never mind this fixed it:

for /r C:\1\ %%f in (*) do if exist "C:\2\%%~nxf" del /s /q "C:\1\%%~nxf
0

精彩评论

暂无评论...
验证码 换一张
取 消