1

I want pass specific parameters(aaa|bbb|ccc) but it's not working.

Here's what the command line looks like:

    test.bat aaa|bbb|ccc

and test.bat looks like:

    echo %1

but its not working cuz test.bat receive only 'aaa'. how can I pass whole parameter 'aaa|bbb|ccc'?

ps. I must use this format : 'aaa|bbb|ccc' there is no option to change like aaa_bbb_ccc.. etc.

1

2 Answers 2

1

Using the "|" means you use the pipe function. http://ss64.com/nt/syntax-redirection.html

You should use "aaa|bbb|ccc" so that it will read everything between the quotation marks.

I hope it helps

Sign up to request clarification or add additional context in comments.

1 Comment

... and echo %~1 to remove the quotes, if needed.
1

The VERTICAL BAR is the pipe character to command.com and cmd.exe. If you want to use is literally, it must be escaped using a CARET.

K:>echo aaa^|bbb^|ccc
aaa|bbb|ccc

Actually, I think I might prefer the quoting suggestion as it appears to work under bash and perhaps other shells.

$ echo "aaa|bbb|ccc"
aaa|bbb|ccc

$ echo 'aaa|bbb|ccc'
aaa|bbb|ccc

1 Comment

@user3460334 - Please mark one of the responses as the "Answer." That's how the SO community works.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.