+ Post New Thread
Results 1 to 9 of 9
Coding Thread, Need help with a batch script! in Coding and Web Development; Trying to force an MSI out to the remaining computers which seem to be playing stubborn installing Chrome with software ...
  1. #1
    Chaddy's Avatar
    Join Date
    Nov 2012
    Location
    Orrell, Greater Manchester
    Posts
    34
    Thank Post
    8
    Thanked 3 Times in 2 Posts
    Rep Power
    5

    Need help with a batch script!

    Trying to force an MSI out to the remaining computers which seem to be playing stubborn installing Chrome with software installation GPO, so going to do it with a script instead.
    However I'm not getting anywhere with this script so far, and I don't know what I'm doing wrong

    Code:
    @echo off
    
    Set File="C:\%programfiles%\Google\Chrome\Application\chrome.exe"
    
    
    If Not Exist %file% Goto Google
    
    
    If Exist %File% Goto TheEnd
    
    
    :Google
    msiexec /package "\\SERVER\SOFTWARE\GOOGLEAPPS\GoogleChrome\GoogleChromeStandaloneEnterprise.msi" /quiet
    
    
    
    
    :TheEnd 
    echo Chrome exists!
    Regards,
    Chaddy

  2. #2
    BKGarry's Avatar
    Join Date
    Mar 2006
    Location
    Kent
    Posts
    1,018
    Thank Post
    105
    Thanked 144 Times in 114 Posts
    Rep Power
    52
    Does the set file need to have c:\ specified before the program files variable, as that may be causing two incidents of C:\ to be showing in the script

  3. #3

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,824
    Thank Post
    372
    Thanked 544 Times in 507 Posts
    Rep Power
    184
    May be missing the obvious, but you didn't tell it to install?

    msiexex /i "PackageName" etc? Your line /package doesn't do anything as far as I know unless I'm being stupid this morning

    *Edit - Seems it does work on some versions with /package too, so ignore me!

    Steve

  4. #4
    themightymrp's Avatar
    Join Date
    Dec 2009
    Location
    Leeds, West Yorkshire
    Posts
    1,291
    Thank Post
    219
    Thanked 238 Times in 206 Posts
    Rep Power
    76
    I would normally use the syntax of

    msiexec /I "package source" /q

    But looking at your script it seems to be viable? When you say its not working, does it fail straight away? Could it be anything to do with 64bit windows? As in, is it trying to install to "C:\Program Files (x86)" ?

  5. #5
    Guest

    Join Date
    Jun 2009
    Posts
    3,754
    Thank Post
    1,458
    Thanked 493 Times in 376 Posts
    Rep Power
    0
    You may also want to take into account 64-bit devices (if you have them) as Chrome will be installed to %ProgramFiles(x86)%.

    Also, @BKGarry is right, remove the C: from the SET FILE line as it's included in the %ProgramFiles% variable path.
    Last edited by Rawns; 17th June 2013 at 12:33 PM.

  6. #6


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,507
    Thank Post
    871
    Thanked 862 Times in 681 Posts
    Rep Power
    199
    Possibly better to look in the registry for installed s/w rather than the filesystem?

  7. #7


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,808
    Thank Post
    262
    Thanked 2,968 Times in 2,183 Posts
    Rep Power
    847
    Try this...

    Code:
    @ECHO OFF
    
    IF DEFINED ProgramFiles(x86) (
       :: 64-bit OS
       Set CHROME="%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
    ) ELSE (
       :: 32-bit OS
       Set CHROME="%ProgramFiles%\Google\Chrome\Application\chrome.exe"
    )
    
    IF NOT Exist %CHROME% msiexec /i "\\SERVER\SOFTWARE\GOOGLEAPPS\GoogleChrome\GoogleChromeStandaloneEnterprise.msi" NOGOOGLEUPDATEPING=1 REBOOT=ReallySuppress /QN

  8. #8
    Chaddy's Avatar
    Join Date
    Nov 2012
    Location
    Orrell, Greater Manchester
    Posts
    34
    Thank Post
    8
    Thanked 3 Times in 2 Posts
    Rep Power
    5
    Removing the drive letter sorted it, I wasn't aware that the programfiles variable included. I should of known that tbh, silly me.

    Thanks Arthur, I may look at that in the future, but atm isn't necessary as our machines are all 32bit.

    Thanks for the help guys!
    Last edited by Chaddy; 18th June 2013 at 08:41 AM.

  9. #9


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,808
    Thank Post
    262
    Thanked 2,968 Times in 2,183 Posts
    Rep Power
    847
    Quote Originally Posted by Chaddy View Post
    I may look at that in the future, but atm isn't necessary as our machines are all 32-bit.
    The batch file will still work even if you only ever use it on 32-bit OSs.



SHARE:
+ Post New Thread

Similar Threads

  1. Need help with batch files please!
    By richrad_mills in forum Windows
    Replies: 13
    Last Post: 23rd June 2010, 08:24 PM
  2. Need help with this damn "job evaluation"..
    By Oops_my_bad in forum General Chat
    Replies: 3
    Last Post: 4th May 2008, 08:26 PM
  3. need help with wsus 3.0 urgent
    By goodhead in forum Windows
    Replies: 10
    Last Post: 2nd October 2007, 11:42 AM
  4. need help with few A+ core questions
    By projector1 in forum General Chat
    Replies: 24
    Last Post: 26th February 2007, 01:08 PM
  5. A Few Things I Need Help With
    By Pear in forum Windows
    Replies: 11
    Last Post: 13th October 2005, 08:42 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •