Solved How to make a file-renaming batch file?

Asus X54l-bbk2 15.6 black notebook (2.2...
August 1, 2012 at 17:38:18
Specs: Windows 7, Intel core i3 2.2 GHz
How would i go about making a batch file to rename a set file name (file name x) into another file (file name y) and also work so if the file was already named (file name y) it would rename to (file name x)? In another words, toggle between file names, because i need 2 different files to run on a program that will run the file only if it is named a specific name, and i want to simplfy the process of switching the file.

See More: How to make a file-renaming batch file?

Report •

August 1, 2012 at 18:43:25
✔ Best Answer
not sure... your first part of your description seems to conflict with the latter part.
I take it you just need "whatever" file to be named THIS_SPECIFIC_FILE prior to running the program. Or maybe you want two files to toggle into place (ie: every other run, swap out the files). I'll take a swing at this pitch:
if exist x (
move THIS_FILE y
move x THIS_FILE
) else (
move THIS_FILE x
move y THIS_FILE
only x OR y should exist, not both. The other (non-ex) one is always in THIS_FILE.
not tested

Report •
Related Solutions

Ask Question