Batch file command line arguments

Posted by Hema Joshi on Stack Overflow See other posts from Stack Overflow or by Hema Joshi
Published on 2010-05-21T07:51:29Z Indexed on 2010/05/21 8:00 UTC
Read the original article Hit count: 341

Filed under:
|

hi i want to execute a command that is saved as a string

e.g

test.bat

call temp.bat  "echo hello world"  "echo welcome"

temp.bat

set first=%1

set sec=%2

%first%

%sec%

please tell me how to do this

thanks

© Stack Overflow or respective owner

Batch file command line arguments

Posted by Hema Joshi on Stack Overflow See other posts from Stack Overflow or by Hema Joshi
Published on 2010-05-21T05:58:07Z Indexed on 2010/05/21 7:30 UTC
Read the original article Hit count: 341

Filed under:
|

I want to pass a command as a command line argument from one batch file to another

e.g.

first.bat

    call test.bat "echo hello world" "echo welcome "

test.bat

set initialcommand=%1

set maincommand=%2

%maincommand%

%initialcommand%

© Stack Overflow or respective owner

Related posts about batch

Related posts about command