Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Need a batch file to increment the file or folder name after renaming

$
0
0

Hi, can anyone tell me how do i rename a file or folder in a shared path so that the last part of the name is incremented automatically next time when i run the batch file again.

For example if the initial name of the folder is say xyz and first time i run the batch file it's renamed to xyz1 and when second time i run the batch file again, it's renamed to xyz2, i mean it should take the next integer value and increment it automatically without me specifying and changing the batch file every time with the new names.

Can this be done with the ren command and adding any kind of variable to the original batch file. The original name shouldn't change for the file, but only the renamed value should keep on incrementing everytime i run the batch script.

Thanks.


Pallab Chakraborty


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>