Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

batch file to install MSI

Posted on 2009-04-15
9
Medium Priority
?
1,181 Views
Last Modified: 2013-11-14
Hi, I am trying to have an msi install at logon, but I keep getting the not recognized command error. Here is what my batch file looks like
REM batch File to push SysAidAgent
F:\Staging "msiexec /q /I SysAidAgent.msi SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952"

REM batch File to push SysAidAgent
"F:\Staging\msiexec /q /I SysAidAgent.msi SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952"

these are two variations I tried, and none of them worked
0
Comment
Question by:xzay1967
  • 6
  • 3
9 Comments
 
LVL 2

Expert Comment

by:JSunn
ID: 24149685
Can you give an exact description of the error message you receive?
0
 
LVL 2

Expert Comment

by:JSunn
ID: 24149830
I would try reformatting your MSI command like this:

"msiexec.exe /i SysAidAgent.msi SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952 /q /l <logfilelocation>"

Also, in your script, when you execute the msiexec command, is the current working directory where the SysAidAgent.msi is located? Also, I see you specified the /l option to log install progress, but I don't see a logfile location where the log should be stored. You should replace the <logfilelocation> above with wherever you want to store the installation logs.
0
 

Author Comment

by:xzay1967
ID: 24150445
Thank you JSunn.  The SysAidAgent is located in F:\Staging.
Would my script look like this?:
@echo off
Rem This pushes the sysaidagent to end users
"F:\Staging\msiexec.exe /i SysAidAgent.msi SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952 /q /l F:\Staging\Sysaidlog"

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:JSunn
ID: 24150477
Since msiexec.exe is a file located in the system32 directory and not in F:\Staging, you command should look like this:
msiexec.exe /i "F:\Staging\SysAidAgent.msi" SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952 /q /l "F:\Staging\Sysaidlog.log"

Note the locations of the quotes. I also added a .log to your logfile name
0
 
LVL 2

Expert Comment

by:JSunn
ID: 24150529
Additionally, this will only work if the drive F is already mapped. (I'm assuming its a network drive) I believe you can launch using a UNC share path as well like this:

msiexec.exe /i "\\servername\Staging\SysAidAgent.msi" SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952 /q /l "F:\Staging\Sysaidlog.log"

Just make sure you've got the quotes setup properly.
0
 

Author Comment

by:xzay1967
ID: 24150629
Thanks again JSunn. This script is being called from another script that maps all the drives and the printers.
This is the script that makes the call:
REM this installs the SysAidAgent on users' computers
If exist "C:\program files\SysAid" goto End
Call F:\Staging\SysAidInstall.bat
goto end

Can I edit your option to look like this?:
msiexec.exe /i "F:\Staging\SysAidAgent.msi" SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952 /q /l "F:\Staging\Sysaidlog.log"
0
 
LVL 2

Accepted Solution

by:
JSunn earned 2000 total points
ID: 24150732
Yeah that looks good. You could do system specific installation logfiles by changing the logfile to look like this:
msiexec.exe /i "F:\Staging\SysAidAgent.msi" SERVERURL="http://jdrmediasvr:8080" ACCOUNT=free SERIAL=770CAFF1ABC62952 /q /l "F:\Staging\%COMPUTERNAME%_Sysaidlog.log"

That way if thee is an install error on one machine, you can easily find the associated logfile. Otherwise, everything else looks fine.
0
 

Author Closing Comment

by:xzay1967
ID: 31570526
Thank you , thank you. The script worked like a champ.
0
 
LVL 2

Expert Comment

by:JSunn
ID: 24150957
Glad to help man.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This is a fine trick which I've found useful many times, when you just don't want to accidentally run a batch script or the commands needs administrator rights.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question