-2

Hi basically I have this text file with the name "Report 08/11/2015",

I would like to create a batch file which when clicked would set the current date, or at least increment the numbers.

Any idea how I could do this?

Sender
  • 6,660
  • 12
  • 47
  • 66

1 Answers1

0

Managed to do it, sorry if my question wasn't so clear but this basically changes the text file name to the current date

@echo off
for /f "delims=" %%a in ('wmic OS Get localdatetime  ^| find "."') do set "dt=%%a"
set "YY=%dt:~2,2%"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%"
set "Min=%dt:~10,2%"
set "Sec=%dt:~12,2%"

set datestamp=%YYYY%%MM%%DD%
set timestamp=%HH%%Min%%Sec%
set fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%

ren "C:\Users\np\Desktop\text.txt" "Report - %fullstamp%.txt"