Solved

batch file to install MSI

Posted on 2009-04-15
9
1,166 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

One of the frequent problems with the installations is when some file or registry entry is not removed from the system upon un-installation of the product. Clean removal is always highly desirable. One major reason for that is badly authored inst…
Installations often have prerequisites, such as “Microsoft .Net framework is required for this product”. The usual implementation in MSI installations is system search for a particular registry setting representing the required prerequisite, followe…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 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