?
Solved

running multiple commands from 1 batch file

Posted on 2013-11-30
2
Medium Priority
?
504 Views
Last Modified: 2013-11-30
Folks

I have  a batch command that gets run, inside this file there is the following statement

serverhealtcheck.bat -h0.0.0.0.1:7001 -sSVR01 -uBLOGGSJ -psecret01 -fabc.log

i would like the same batch file to run multiple of these statements for different environments

serverhealtcheck.bat -h0.0.0.0.1:7001 -sSVR01 -uBLOGGSJ -psecret01 -fabc.log
serverhealtcheck.bat -h0.0.0.0.2:7002 -sSVR01 -uSMITHP -psecret02 -fabc.log
serverhealtcheck.bat -h0.0.0.0.1:7003 -sSVR01 -uWOODT -psecret03 -fmy.log


how do i achieve this?
0
Comment
Question by:rutgermons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 56

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 39687485
Just add the lines to the BAT file and they will be executed one after the other.  Since you are running a second BAT file from the first, use the CALL command so that after each called BAT file executes, it will come back to the first and continue.  So your bat file would look like:

@echo off
call serverhealtcheck.bat -h0.0.0.0.1:7001 -sSVR01 -uBLOGGSJ -psecret01 -fabc.log
call serverhealtcheck.bat -h0.0.0.0.2:7002 -sSVR01 -uSMITHP -psecret02 -fabc.log
call serverhealtcheck.bat -h0.0.0.0.1:7003 -sSVR01 -uWOODT -psecret03 -fmy.log

Open in new window

~bp
0
 

Author Closing Comment

by:rutgermons
ID: 39687491
Thanks Bill, simple enough and most importantly working as expected
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question