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?
Batch file to install multiple softwares
Moderator: DosItHelp
Re: Batch file to install multiple softwares
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
Thanks for reply foxidrive. what is switches in installation programs ?
Re: Batch file to install multiple softwares
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.
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
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"
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"
-
- Posts: 13
- Joined: 26 Sep 2012 12:08
Re: Batch file to install multiple softwares
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.