0

I have a Batch script where I want to move the files from one folder to another. But the challenge here is the name of the folder where I am moving the file to changes based on date also file name changes based on current date e.g. date_file_name. I tried this approach,

@ECHO OFF
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
     set dow=%%i
     set month=%%j
     set day=%%k
     set year=%%l
)
set day=%month%%day%%year%
echo %day%
set f_name=BulkScript.sh
echo %f_name%

echo "Renaming the downloaded script...."
ren %f_name% %day%_%f_name%

echo "Move the file"
move C:/Users/Downloads/%day%_%f_name% C:/Users/Downloads/%day%/

So I wanna move file from Downloads to day folder. The % here gives me error, of course I am new to Batch programming. Any help will be appreciated.

Rob
  • 141
  • 1
  • 1
  • 15

0 Answers0