Solved

batch file to install MSI

Posted on 2009-04-15
9
1,160 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

One of the major drawbacks of deploying applications by GPO is the complete lack of any centralized reporting. After a normal deployment, there are two ways to find out if it was successful – by looking in the event log, and by looking in the log of…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now