Batch file/Copy
I am having problems inserting a few command lines inside a current batch file that my company has been using for awhile now.
This is the current .bat file
setlocal
if "%PROCESSOR_ARCHITEW6432%" == "AMD64" goto SIXFOUR
if "%PROCESSOR_ARCHITEW6432%" == "x86" goto THREETWO
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" goto SIXFOUR
if "%PROCESSOR_ARCHITECTURE%" == "x86" goto THREETWO
:SIXFOUR
"\\fileshare\setup.exe" /action=install /ERRORREPORTING=0 /SQMREPORTING=0 /FEATURES=SQL,AS,RS,IS,Tools /INSTANCENAME=MSSQL2008 /SQLSYSADMINACCOUNTS=BUILTIN\ADMINISTRATORS /AGTSVCACCOUNT="NT AUTHORITY\SYSTEM" /ASSVCACCOUNT="NT AUTHORITY\SYSTEM" /ASSYSADMINACCOUNTS="NT AUTHORITY\SYSTEM" /SECURITYMODE=SQL /SAPWD="xxxx" /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /ISSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /RSSVCACCOUNT="NT AUTHORITY\SYSTEM" /IAcceptSQLServerLicenseTerms /Q
msiexec /i "\\fileshare\MS SQL 2008 Feature Packs\SQLServer2005_BC_x64.msi" /quiet /norestart
msiexec /i "\\fileshare\MS SQL 2008 Feature Packs\SQLServer2005_DTS.msi" /quiet /norestart
\\fileshare\SQL2008DTSFix\install.bat
goto End
:THREETWO
"\\fileshare\setup.exe" /action=install /ERRORREPORTING=0 /SQMREPORTING=0 /FEATURES=SQL,AS,RS,IS,Tools /INSTANCENAME=MSSQL2008 /SQLSYSADMINACCOUNTS=BUILTIN\ADMINISTRATORS /AGTSVCACCOUNT="NT AUTHORITY\SYSTEM" /ASSVCACCOUNT="NT AUTHORITY\SYSTEM" /ASSYSADMINACCOUNTS="NT AUTHORITY\SYSTEM" /SECURITYMODE=SQL /SAPWD="xxxx" /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /ISSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE" /RSSVCACCOUNT="NT AUTHORITY\SYSTEM" /IAcceptSQLServerLicenseTerms /Q
msiexec /i "\\fileshare\MS SQL 2008 Feature Packs\SQLServer2005_BC.msi" /quiet /norestart
msiexec /i "\\fileshare\MS SQL 2008 Feature Packs\SQLServer2005_DTS.msi" /quiet /norestart
\\fileshare\SQL2008DTSFix\install.bat
goto End
:End
Endlocal
And these are the lines I am looking to add which simply copies 4 files from the file share into Program Files (are the same for both 32 and 64 bit):
copy /y "\\fileshare\Templates\Create Stored Procedure (New Menu).sql" "%ProgramFiles(x86)%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\Stored Procedure\"
copy /y "\\fileshare\Templates\Create Multi-statement Function (New Menu).sql" "%ProgramFiles(x86)%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\Function\"
copy /y "\\fileshare\Templates\Create Scalar Function (New Menu).sql" "%ProgramFiles(x86)%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\Function\"
copy /y "\\fileshare\Templates\Create T-SQL Trigger (New Menu).sql" "%ProgramFiles(x86)%\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql\Trigger\"
The one location I thought would work is directly after \\fileshare\SQL2008DTSFix\install.bat in both the 32 and 64 bit blocks, though I have tried multiple parts of the script. I have also tried creating a new batch file with
just those 4 lines and calling that file. The weird thing is that after the script finishes successfully, I am able to run the batch file with just those 4 lines and they copy with no problem.
Any ideas?
January 19th, 2012 4:22pm