I want to toggle the names of two files, using a batch file (Windows 7 command-line). I wrote the following code, but its not working.
IF EXIST test12.txt
rename test.txt test23.txt
rename test12.txt test.txt
Could someone help me correct this code?
Thanks.
EDIT: When I run from the command line, it says “The syntax of the command is incorrect”. What is the syntax then? Is this only for checking the existence of directories?
Not sure if this is what you are asking. Perhaps your IF clause isn’t correct. By using () the code should improve.