I need to copy a .dll assembly to a couple of places and register it in in the Global Assembly Cache.
A .bat file was provided as below:
=====================
@echo off
copy "C:\TK463\Chapter19\Lesson3\Starter\TK463 Chapter 19\TK463.CalculateCheckSum\bin\Release\TK463.CalculateCheckSum.dll" "%ProgramFiles(x86)%\Microsoft SQL Server\110\DTS\PipelineComponents" /Y
copy "C:\TK463\Chapter19\Lesson3\Starter\TK463 Chapter 19\TK463.CalculateCheckSum\bin\Release\TK463.CalculateCheckSum.dll" "%ProgramFiles%\Microsoft SQL Server\110\DTS\PipelineComponents" /Y
echo.
"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64\gacutil" /u TK463.CalculateCheckSum
echo.
"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64\gacutil" /i "d:\ProgramFiles%\Microsoft SQL Server\110\DTS\PipelineComponents\TK463.CalculateCheckSum.dll"
echo.
"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64\gacutil" /i "d:\ProgramFiles(x86)%\Microsoft SQL Server\110\DTS\PipelineComponents\TK463.CalculateCheckSum.dll"
=====================
Solution:
In order to make it work, I need to make the following changes:
1. Change C:\TK463\... to C:\Users\CK\Downloads\...
2. Change "%ProgramFiles(x86)%\Microsoft SQL Server\110\DTS\PipelineComponents" to "D:\Program Files(x86)\Microsoft SQL Server\110\DTS\PipelineComponents", which is the DTS folder on my pc, note there is space between Program and Files(x86), similarly
3. Change "%ProgramFiles%\Microsoft SQL Server\110\DTS\PipelineComponents" to "D:\Program Files\Microsoft SQL Server\110\DTS\PipelineComponents"
4. I added timeout /t 60 at the end of the batch file to pause the message for 60 seconds.