I am trying to write a batch file on a USB drive to install multiple programs to a PC. This is to be used for new PC installs for a client. Basically what i want it to do is install these programs one at a time, and skip any programs that are already installed, due to some of them requiring a restart. The first program is of course Office 365. here is what i have so far:
@echo off
IF EXIST "C:\Program Files\Microsoft Office 15\ClientX64\OfficeClickToRun.exe" GOTO :END
pause
start D:\Clientfolder\ClientPrograms\Setup.Def.en-us_officeinstallfilename
:END
:sub_message
Office installed
I added a pause to better diagnose the issue. The problem is that no matter what form i put the file path in, it either skips to start the installation, even though i have confirmed the location of the existing file, or doesn't pause at all. I am very new to batch files, in fact this is only the third or fourth that i have ever written, and the previous required much googling, but this time i am stuck. Any suggestions are appreciated!
Batch for multiple program installs
Moderator: DosItHelp
-
- Posts: 4
- Joined: 09 Apr 2020 11:05
Re: Batch for multiple program installs
Try this:
Code: Select all
@echo off
IF EXIST "C:\Program Files\Microsoft Office 15\ClientX64\OfficeClickToRun.exe" GOTO sub_message
echo Office not Installed
echo Starting Office Installation...
"D:\Clientfolder\ClientPrograms\Setup.exe"
pause
goto end
:sub_message
echo Office is Installed
pause
goto end
pause
:end