开发者

renaming files in subdirectories with a DOS-Batch

i want a BATch to check if 2 given files are in the directory + if they are change their names

so far i have gotten this:

@echo off

if exist %order.xml && %order.xml.orig goto RENAME
goto END

:RENAME
rename order.xml order.xml.old
rename order.xml.orig order.xml

:END
pause

which works just fine, but the problem is i have to copy this into each subdirectory开发者_运维知识库. is there a way to let the BATch check every subfolder? everything i tryed just gave me an syntax-error


You are looking for this:

recursive renaming file names + folder names with a batch file

All it is is a for loop with a goto statement. The answer actually just renames files, not folders so should be exactly what you wanted.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜