Page 1 of 1

Batch file to install multiple softwares

Posted: 03 Sep 2013 00:47
by pari.vinu
I am new to windows batch file. Here is my first attempt in batch file. Here is my requirement:

I should have batch file. When executes, it should read the XML config file for the software to be installed and the location of destination.

When I execute the batch script, it should install all the software mentioned in the XML config file, without user intervention.

All the software are .exe extension

For now, I have started with installing one software like below:

set tool=\\igdb001\didc0005\50_Tools\SW\TotalCommander\02_Installation
echo installing the tool commander
start /w %tool%\tcm801x64.exe /silent
echo finished installing
It is prompting for user to choose the option during installation. How should automate it?

Re: Batch file to install multiple softwares

Posted: 03 Sep 2013 03:14
by foxidrive
If the installation programs all have switches for silent installs then you can do it using the switches.

Re: Batch file to install multiple softwares

Posted: 03 Sep 2013 19:59
by pari.vinu
Thanks for reply foxidrive. what is switches in installation programs ?

Re: Batch file to install multiple softwares

Posted: 03 Sep 2013 20:25
by foxidrive
A switch is similar to a /b switch in a DIR command such as DIR /b
This switch tells the DIR command to do something differently, in this case it returns a brief directory listing.


Most installation programs use switches to control the installation, or it may have no switches to control the installation and just uses a GUI for the user to control.

It is up to you to find out if the EXEs have command line switches and what they are - as an example /silent is sometimes used.

Re: Batch file to install multiple softwares

Posted: 04 Sep 2013 02:12
by pari.vinu
Ok. Thanks foxidrive. now i got the idea of switched.
Currently I am able to install the software by making auto=1 in install.inf file and then with the following script I am able to install.
@echo off
for /F "tokens=2 delims=<>" %%i in ('type test.xml ^|find "<install>"') do (
set setup=%%i
echo installing %installer% >>log.txt
%setup%
)
@echo on

XML confif file
<?xml version="1.0" encoding="UTF-16"?>

<install>C:\Users\UIDW6331\Desktop\tcm801x64\INSTALL.EXE</install>
<install>C:\Users\UIDW6331\Desktop\tcm801x64\INSTALL.EXE</install>

I am able to install it however I want to install it in specific destination directory . how do i do that ?

and also when I mention switches like below
start /w %setup% /norestart /silent
or
%setup% /passive /norestart
I am observing the following error.

"The setup information file was not found. you need to unpack the whole archive before running the install.exe. installation aborted"

Re: Batch file to install multiple softwares

Posted: 05 Sep 2013 18:42
by Jess Selien
Look into the chdir command for executing the install from the working directory. Otherwise for a permanent change you may want to look into altering the "path" environment variable.