问题描述
我正在尝试自动化SQL Server 2016,但SQL 2016已安装但SQL服务器管理工作室未安装。
我有什么尝试过:
我试过电源外壳它的工作原理当我将电源外壳转换为静态批处理文件时它可以工作,但是通过动态批处理文件它没有。这是我的代码
start%~dp0sql3 \ setup.exe/ SAPWD =Sqladmin1234/ConfigurationFile=\"ConfigurationFile.ini/ quiet
@ECHO OFF
SET LookForFile =C:\ Setup \ssms \ Ssms-Setup-ENU.exe
:CheckForFile
如果EXIST%LookForFile%GOTO FoundIt
REM如果我们到达此处,则找不到该文件。
REM等待5秒然后重新检查。
REM如果不需要延迟,请注释/删除超时行。
TIMEOUT / T 5> null
GOTO CheckForFile
:FoundIt
ECHO发现:%LookForFile%
startC:\Setup \ssms \Ssms-Setup-ENU.exe / quiet / install / norestart
运行:
C:\ Setup \ssms \Ssms-Setup-ENU.exe / quiet / install / norestart
I am trying to automate the SQL Server 2016 but SQL 2016 gets installed but SQL server management studio doesn't get installed.
What I have tried:
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
这篇关于我默默安装了SQL Server 2016,但管理工作室没有安装在批处理文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!