Deploy .msi with a .bat
Solved
reno732
Posted messages
227
Status
Member
-
reno732 Posted messages 227 Status Member -
reno732 Posted messages 227 Status Member -
Hello,
I have several software applications to deploy on a large IT infrastructure. I would like to first create a .bat file that launches the installation of the .msi files located on the shared network location \\server\msi$ with the rights of the domain admin user admin@domain.lan and the password as the admin user's password.
I want the installation of the msis to occur automatically without any user intervention.
For now, I am starting with the command
runas /user:admin@domain.lan msiexec.exe -i \\server\msi$\application.msi
I have .msi and .mst files. In fact, for part of the IT infrastructure, the usual provider does not intervene but I have the sources for all the applications that are normally deployed in the managed OU.
Thank you in advance.
I have several software applications to deploy on a large IT infrastructure. I would like to first create a .bat file that launches the installation of the .msi files located on the shared network location \\server\msi$ with the rights of the domain admin user admin@domain.lan and the password as the admin user's password.
I want the installation of the msis to occur automatically without any user intervention.
For now, I am starting with the command
runas /user:admin@domain.lan msiexec.exe -i \\server\msi$\application.msi
I have .msi and .mst files. In fact, for part of the IT infrastructure, the usual provider does not intervene but I have the sources for all the applications that are normally deployed in the managed OU.
Thank you in advance.
2 answers
So for the command to start the installation, it was successful:
start /wait msiexec /i "\\server\msi$\applications\applis.msi" /qn
start /wait msiexec /i "\\server\msi$\applications2\applis2.msi" /qn
...
I also have a rights issue to resolve:
What option should I add to RUNAS in an Active Directory domain?
I would like to check if the programs are already installed before running this script...
start /wait msiexec /i "\\server\msi$\applications\applis.msi" /qn
start /wait msiexec /i "\\server\msi$\applications2\applis2.msi" /qn
...
I also have a rights issue to resolve:
What option should I add to RUNAS in an Active Directory domain?
I would like to check if the programs are already installed before running this script...
for /f "tokens=3*" %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^| Find "ProductName"') do set WINVER=%%i %%j
echo %WINVER% | find "XP" > nul && goto commands
if "%1" == "UAC" goto elevation
(
echo Set objShell = CreateObject("Shell.Application")
echo Set objFSO = CreateObject("Scripting.FileSystemObject")
echo strPath = objFSO.GetParentFolderName(WScript.ScriptFullName)
echo If objFSO.FileExists("%~0") Then
echo objShell.ShellExecute "cmd.exe", "/c ""%~0"" UAC """%~dp0"""", "", "runas", 1
echo Else
echo MsgBox "Script file not found"
echo End If
) > "%TEMP%\UAC.vbs"
cscript //nologo "%TEMP%\UAC.vbs"
goto :eof
:elevation
del /q "%TEMP%\UAC.vbs"
:commands
%~d2
cd "%~p2"