I am trying to silently install the SQL Server 2016 but SQL 2016 gets installed but SQL server management studio doesn’t get installed.
I tried by power shell it works and when i convert power shell to static batch file it works but by dynamic batch file it doesn’t. This is my code
start “” “%~dp0sql3\setup.exe” /SAPWD=“Sqladmin1234” /ConfigurationFile=“ConfigurationFile.ini” /quiet
@ECHO OFF
SET LookForFile=“C:\Setup\ssms\Ssms-Setup-ENU.exe”
:CheckForFile
IF EXIST %LookForFile% GOTO FoundIt
REM If we get here, the file is not found.
REM Wait 5 seconds and then recheck.
REM If no delay is needed, comment/remove the timeout line.
TIMEOUT /T 5 >null
GOTO CheckForFile
:FoundIt
ECHO Found: %LookForFile%
start “C:\Setup\ssms\Ssms-Setup-ENU.exe /quiet /install /norestart”
run:
C:\Setup\ssms\Ssms-Setup-ENU.exe /quiet /install /norestart
Which part of the batch doesn’t work? does your batch could go for :FoundIt
label?
About management studio, I think it’s a standalone application, and when you ask to setup SQL itself, it doesn’t come with mgm studio. You may need to run another setup maybe, or different argument, IDK.
Also make sure you run the command as administrator.
The part of the batch that doesn’t work
ECHO Found: %LookForFile%
start “C:\Setup\ssms\Ssms-Setup-ENU.exe /quiet /install /norestart”
run:
C:\Setup\ssms\Ssms-Setup-ENU.exe /quiet /install /norestart
I need help to find that argument which i can add and it is running as administrator
The batch invoker itself should be run as administrator, not the batch file. Batch file is just a simple text file, this is cmd.exe that runs your script. check for runas
You sure it reaches this line?! How do you confirm?
Also make sure this start “” “%~dp0sql3\setup.exe” /SAPWD=“Sqladmin1234” /ConfigurationFile=“ConfigurationFile.ini” /quiet
part is valid.
How did you come with this command?
That ~dp0sql3
looks like a temp path for me, not sure.
i even tried this code
start “” “%~dp0sql3\setup.exe” /SAPWD=“Sqladmin1234” /ConfigurationFile=“ConfigurationFile.ini” /quiet
sleep 230
start “C:\Setup\ssms\Ssms-Setup-ENU.exe /quiet /install /norestart”
here sleep is used to delay the second install
SQL 2016 GETS INSTALLED AND THIS WINDOWS POPS UP
I think I’m now a little confused
please don’t, I’m not windows fan and expert, but I believe this is possible to wait for a process exit(return) and then continue next statements/command. that sleep 230 is not good.
About the windows popup, you supposed to not get it opened? try chp enables you hide the cmd windows.