My batch file is creating a new folder instead of using the one already created
Posted on 2013-06-07
I have a batch file that takes a spreadsheet from one folder, and moves it to another. So, I have a folder called Estimates on the D drive, D:\Estimates. Then, I have a folder on the D drive called Finalize, D:\Finalize. The batch file is supposed to move the spreadsheet from the Estimates folder into the Finalize folder using the date as the folder name. Everything works, except when i run the batch file, it is created a totally new folder called Finalize, instead of using the one i already have created. Why isn't it using the folder "Finalize" I already created? I don't want it to create a new folder. I checked spelling, and its all correct. Here's my script:
set backupcmd=xcopy /s /c /d /e /h /i /r/ k /y
echo ### Backing up directory...
%backupcmd% "D:\Estimate" "%drive%\%folder%"