1.

Solve : Rename adding date in XP?

Answer»

I used a batch to rename a FILE as following on Windows 2000: ren test.xml test%date:~4,2%-%date:~7,2%-%date:~10%.xml This worked fine.
Now, I'm working on XP and it doesn't work anymore.
How can I get it to work again?How do you know it didn't work? Did it not rename the file or did you get an error message. It would have been helpful had you posted the error message. The command syntax is fine.

Does test.xml exist?
Does test.xml exist in the same directory as the batch file? If not you need a relative path or a FULLY qualified path to test.xml.

Guesswork is fine, but we need more details.

Let us know. I do not get an error message.
test.xml exists.
Also, the batch file works if I ask it to rename the file to test1.xml.I cut and pasted your code and it works fine (on an XP machine). TRY turning ECHO on and when the batch file runs, NOTICE how the variables get resolved.

This is pretty basic stuff. If you still have problems, post your batch file and let us know what directory your logged into when you run the batch file. Also what directory test.xml lives in.



Discussion

No Comment Found