开发者

Rename works for one but not the other

My batch file has the following code:

rename And.mk Andold.mk
rename Test1.txt And.mk

When I execute the batch file, it renames Test1.txt to And.mk, but does not rename And.mk to Andold.mk. Why is this happening?

  • I tried with ren and REN as well.. but no change
  • I checked file permission of And.mk and gave it full permission.. but still did not work
  • The folder shows two And.mk now without any conflict...

* - Am working on Windows7 by the way....

开发者_开发百科

@Andriy - Thanks for your reply.1) I checked Registered file types...mk files are present by default 2)I am not changing the name of Test1.txt manually..the whole purpose of this is for the batch file to do the work for me


You might want to wait after renaming the first file for sometime, maybe the file is still being processed and thus no other file can be named the same name, so try the following:

rename And.mk Andold.mk
timeout /T 500
rename Text1.txt Andmk
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜