Copy from previous date folder to current date folder
Posted: 02 Feb 2018 03:24
Hi,
I want to copy all files & folders from a parent source folder to destination folder of current date inside a batch script such that as below.
I had make it partially completed to create the destination folder whose name be such like pre-concatenated string "PNSH" + "current date"
xcopy "%source%" "%destination%" /E /Y
For Example
PNSHddmmyyyy format i.e. PNSH03022018
to do this code has written as like this
SET dirname="PNSH%date:~0,2%%date:~3,2%%date:~6,4%"
MKDIR %dirname%
The source folder is as below same as above format
PNSHddmmyyyy format i.e. PNSH02022018
Help me for appropriate batch script.
:)
I want to copy all files & folders from a parent source folder to destination folder of current date inside a batch script such that as below.
I had make it partially completed to create the destination folder whose name be such like pre-concatenated string "PNSH" + "current date"
xcopy "%source%" "%destination%" /E /Y
For Example
PNSHddmmyyyy format i.e. PNSH03022018
to do this code has written as like this
SET dirname="PNSH%date:~0,2%%date:~3,2%%date:~6,4%"
MKDIR %dirname%
The source folder is as below same as above format
PNSHddmmyyyy format i.e. PNSH02022018
Help me for appropriate batch script.
:)