i have created a batch file which copy the data of one folder into another. But after copying i want to give the naem as a folder name. I am not able to. Please give your suggestions. sorry for changing the question. but now i need this.
This is my code.
@echo off
:: variables
echo Backing up file
set /P source=Enter source folder:
set /P destination=Enter Destination folder:
set listfile=xcopy /L
set xcopy=xcopy /S/E/V/Q/F/H
%listfile% %source% %destination%
echo files will be copy press enter to proceed
pause
%xcopy% %source% %destination%
pause
I take it (based on comments) you want to append the date and time to the destination folder. As shown below, use one set command to convert date&time to a format you can use in a folder name (explained here) and another to set the new folder name. After the xcopy, use the move command to rename the folder. (See cited source about keeping quote marks around the %datename% folder.)