Skip to main content
edited tags
Link
Gilles Quénot
  • 4.4k
  • 1
  • 29
  • 28
Source Link

Dynamically changing dates in command Prompt

I am trying to write a command prompt in changing file names for a monthly report I run and am automating.

I have the export file as "Export.xlsx", and I want to change it to 02 2018.xlsx, 03 2018.xlsx, etc, without having to go into the code each month and change the number. Is there a way that Windows can sense what numbers are in the folder already and add 1 number to the file name? Here is the current lines I have. If the arrangement of numbers needs to change for this to be possible, that is just fine.

rename "File Path\Projects_Log.csv" "03 18 Projects_Log.csv"