Solved Batch rename / switch files

September 6, 2013 at 10:12:24
Specs: Windows 7
I have two different configurations of the same settings file I use with a given program (VLC) and I would like a batch file that replaces one with the other. The file is called vlcrc, with no extension. I have a second file, vlcrc-2, that is the other configuration that I use. My current method for changing it is to navigate to the folder, rename vlcrc to vlcrc-1, then rename vlcrc-2 to vlcrc. When I switch back, I reverse it.

I would like a batch file that does that. So, if vlcrc-2 exists, rename vlcrc to vlcrc-1 and rename vlcrc-2 to vlcrc. If vlcrc-1 exists, rename vlcrc to vlcrc-2 and rename vlcrc-1 to vlcrc.

Oh, the file is in C:\Users\brian\AppData\Roaming\vlc and I would like to be able to run this batch from my desktop, so that should probably be in there :)

See More: Batch rename / switch files

Report •

September 6, 2013 at 11:57:00
✔ Best Answer
It'd be easier to go with "vlcrc" and "vlcrc.other". Easy enough that your script would be 3 lines:
ren "%appdata%\vlc\vlcrc" vlcrc.tmp
ren "%appdata%\vlc\vlcrc.other" vlcrc
ren "%appdata%\vlc\vlcrc.tmp" vlcrc.other

How To Ask Questions The Smart Way

message edited by Razor2.3

Report •

September 6, 2013 at 11:59:54
Thanks so much. I figured it was something simple like that, but I had no idea it would be that simple. In my head, there were loops, so I vastly prefer your method. Thanks again!

message edited by Nanook

Report •

Related Solutions

Ask Question