Batch file not working

hi,

I want to create a batch file that would copy two files from the desktop to a directory i just created, then once everything is copied delete the files form the desktop, I am going step by step since it has been years since the last time i created a batch file so bear with me :-)
here is my starting code:
echo off
cd %userprofile%\Desktop
md "BSR Upgrade"
cd %userprofile%\Desktop
copy bsrupins.bat %userprofile%\Desktop\bsrupg~1
copy adv_cust.pbd %userprofile%\Desktop\bsrupg~1
***** ERROR: The syntax of the command is incorrect ********************
del bsrupins.bat
del adv_cust.pbdecho Your Advance has been succesfully upgraded press any key to continue
pause
****** IS THERE A WAY TO DELETE THE FILE IS EXECUTING ONCE IS FINISHED *****************
exit
Thank you!!
LVL 4
abitounAsked:
Who is Participating?
 
SteveGTRConnect With a Mentor Commented:
You should use quotes around your directory names:

cd "%userprofile%\Desktop"

Remember the space issue that you had on the previous question.

You can delete the batch file:

del "%~f0"

I'd do it prior to the exit.
0
 
Doc_McAlisterCommented:
This line is bad syntax:

del adv_cust.pbdecho Your Advance has been succesfully upgraded press any key to continue

Try

del adv_cust.pbdecho
echo Your Advance has been succesfully upgraded press any key to continue
0
 
abitounAuthor Commented:
It worked!!! Thank you!
0
All Courses

From novice to tech pro — start learning today.