Solved

Skip .bat installation if present

Posted on 2011-03-09
4
412 Views
Last Modified: 2012-05-11
I am planning to run a silent installation on my clients, using a .bat login script. How can I prevent the installation to start over the next time they log in? I of course can't remove the bat file before I am pretty sure it has been installed everywhere. I add this to my script:

@echo off
msiexec /qn /i "\\10.218.110.21\Setup_Addin\Mailbox Central Outlook Addin.msi"
0
Comment
Question by:happyhenrik
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
gavsmith earned 400 total points
Comment Utility
Find one of the files that you know the install puts onto the computer. Then add:

@echo off
if exist "%systemdrive%\Program Files\Mailbox Central Outlook Addin\Somefile.ini" GOTO :ENDINSTALL
msiexec /qn /i "\\10.218.110.21\Setup_Addin\Mailbox Central Outlook Addin.msi"
:ENDINSTALL

Obvoiusly replace:
"%systemdrive%\Program Files\Mailbox Central Outlook Addin\Somefile.ini"
with the file you know should exist after install
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 100 total points
Comment Utility
You could keep a flag file on your network drive where they have rights to add, e.g.

@echo off
if exist "\\10.218.110.21\Setup_Addin\log\ok\%computername%.txt" exit
msiexec /qn /i "\\10.218.110.21\Setup_Addin\Mailbox Central Outlook Addin.msi"

REM Check if error returned.  If not then log to OK dir.  If error then log to failed dir.
if "%errorlevel%"=="0" (
  echo Installed %date% %time% > "\\10.218.110.21\Setup_Addin\log\ok\%computername%.txt"
) ELSE (
  echo Failed with error %errorlevel% - %date% %time% > "\\10.218.110.21\Setup_Addin\log\failed\%computername%.txt"
)
Then you can also get a look at who has installed / failed to install

Otherwise you could do a registry check to see if already installed perhaps.

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
Comment Utility
Cross posted there with first suggestion.  All depends what the software does during install but a file check, registry check for the MSI entries or similar is good for some, or you can use Group Policy to do the work for instance if you have Active Directory.

Otherwise a log file like suggested means you can see centrally who has run the update and when.
0
 

Author Comment

by:happyhenrik
Comment Utility
gavsmith - it works like a charm, thx
dragon-it - thx for the tip ( I will reward you a little bit :-) )
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
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…

772 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

9 Experts available now in Live!

Get 1:1 Help Now