none
file present if/else RRS feed

  • Question

  • I would like to put commands in a batchfile to see if Office 2010 standard or pro is installed. If not install Office.

    The question for beneath batchfile is: can i put the if and else as it is on one line and could this work? This is the easyast way for me determin if a office 2010 installation exists...

    Therefore i put the following commands in a batchfile: 

    if not exist "c:\program files\Microsoft office\office14\winword.exe" goto deploy else goto mkfile

    :deploy
    \\sharename server\office2010\setup
    goto end

    :mkfile
    ECHO office is reeds aanwezig>c:\temp\off2010.txt
    goto end

    :end


    freddie

    Monday, January 13, 2014 8:03 PM

Answers

  • Many issues here.  This is not a user support forum.  If you do not know how to write a batch file then it is recommended that you seek the assistance of a trained consultant.

    In Windows the installer will handle all of this for you.  Look into how to use the Office installer to validate and install or update office products.  TO do this you will need to post in the Office forum for the version of office you are trying to install.

    Microsoft produces a number of certification courses for admins and technicians that will train you in how to do software maintenance on desktop system.  These courses can make your life much easier.  Ask you manager or supervisor to send you to one of the many training schools to learn how to mange and administer the Windows desktop.

    Checking for the existence of a file does not indicate that Office is installed.  A removed or damaged version of office or a very old or expired trial of office may still have that file in that folder.  THat is why I say you need to learn how Windows software works.


    ¯\_(ツ)_/¯

    Tuesday, January 14, 2014 8:24 AM

All replies


  • if exist "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE" (echo It is installed) else (echo It is not installed)
    

    Bill

    Monday, January 13, 2014 8:11 PM
    Moderator

  • if exist "C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE" (echo It is installed) else (echo It is not installed)
    

    Bill

    I was not complete enough because forgot to say that the goal is to install a new version of office, and i can not see any screen output like text after echo. So thats why made a ECHO to a file, if that works.
    So if Office is present then do nothing is it not present then install (thru a computer GPO in AD)

    Are the () nessecairy?


    freddie

    Tuesday, January 14, 2014 8:08 AM
  • Many issues here.  This is not a user support forum.  If you do not know how to write a batch file then it is recommended that you seek the assistance of a trained consultant.

    In Windows the installer will handle all of this for you.  Look into how to use the Office installer to validate and install or update office products.  TO do this you will need to post in the Office forum for the version of office you are trying to install.

    Microsoft produces a number of certification courses for admins and technicians that will train you in how to do software maintenance on desktop system.  These courses can make your life much easier.  Ask you manager or supervisor to send you to one of the many training schools to learn how to mange and administer the Windows desktop.

    Checking for the existence of a file does not indicate that Office is installed.  A removed or damaged version of office or a very old or expired trial of office may still have that file in that folder.  THat is why I say you need to learn how Windows software works.


    ¯\_(ツ)_/¯

    Tuesday, January 14, 2014 8:24 AM