Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Running batch script with two lscm commands causes finishing script just after finishing first command

I am trying to execute two or more lscm command by storing it as a batch file.

If i try exectue the two commands in separate lines execution for the first command happens successfully and stops for the execution of the second command

it works only when i add "&&" between two commands  but i want each command to be in a new line and execute.  

Example:

NOT WORKING

lscm create workspace -r https:\\Xyxyxy -u User -p password workspaceName1

lscm create workspace -r https:\\Xyxyxy -u User -p password workspaceName2

WORKING

Example

lscm create workspace -r https:\\Xyxyxy -u User -p password workspaceName1&&lscm create workspace -r https:\\Xyxyxy -u User -p password workspaceName2

1 vote


Accepted answer

Permanent link
On Windows lscm itself is a batch command. To call it in a batch file, you may need to use:

call lscm create workspace -r https:\\Xyxyxy -u User -p password workspaceName1
call lscm create workspace -r https:\\Xyxyxy -u User -p password workspaceName2
nanda S selected this answer as the correct answer

2 votes

Comments

Thank you ,It worked!


One other answer

Permanent link
Hi Nanda,
I am assuming that you are using Windows. I was also able to reproduce this issue on Windows.

The work around is to use scm instead of lscm command. This will work for you then.

0 votes

Comments

or as Lily mentioned, use Call

Thank you ,It worked! 

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,204
× 113

Question asked: May 23 '14, 4:25 a.m.

Question was seen: 6,404 times

Last updated: May 26 '14, 4:49 a.m.

Confirmation Cancel Confirm