I have a syntax error in this Batch script, but I have no idea where it is coming from. I'm new to batch so I'm having trouble figuring this out. I have a feeling it's something to do with the if
statement, but am unsure.
@ECHO Off
:: Variables
@SET UI_Debug_Path="rootpath"
@SET CoreDev_Bin="destinationPath1"
@SET Website_Bin="destinationPath2"
@SET Business_DLL="Business.dll"
@SET Business_PDB="Business.pdb"
@SET DataAccess_DLL="DataAccess.dll"
@SET DataAccess_PDB="DataAccess.pdb"
@SET UI_DLL="Forms.dll"
@SET UI_PDB="Forms.pdb"
@SET doCopy=n
:: Prerequisite
echo Ensure you have permission/access to files!
SET /P doCopy=Copy Files (y\n) (Default - n)?
IF /I "%doCopy%"=="Y" (
:: .DLLs
echo "Copying .DLLs to CoreDev\Bin and Website\Bin"
COPY %UI_Debug_Path%%Business_DLL% %CoreDev_Bin%
COPY %UI_Debug_Path%%Business_DLL% %Website_Bin%
:: COPY %UI_Debug_Path%%DataAccess_DLL% %CoreDev_Bin% :: Don't think we need DataAccess.dll copied in CoreDev\bin
COPY %UI_Debug_Path%%DataAccess_DLL% %Website_Bin%
COPY %UI_Debug_Path%%UI_DLL% %CoreDev_Bin%
::COPY %UI_Debug_Path%%UI_DLL% %Website_Bin% :: Don't think we need UI.dll in Website\bin
:: .PDB files
echo "Copying .PDB to CoreDev\Bin and Website\Bin"
COPY %UI_Debug_Path%%Business_PDB% %CoreDev_Bin%
COPY %UI_Debug_Path%%Business_PDB% %Website_Bin%
::COPY "%UI_Debug_Path%%DataAccess_PDB% %CoreDev_Bin% :: Don't think we need DataAccess.pdb in CoreDev\bin
COPY %UI_Debug_Path%%DataAccess_PDB% %Website_Bin%
COPY %UI_Debug_Path%%UI_PDB% %CoreDev_Bin%
::COPY %UI_Debug_Path%%UI_PDB% %Website_Bin% :: Don't think we need UI.pdb in WebSite\bin
)
Pause
The current error I get is:
The syntax of the command is incorrect.