Neville Nazerane
Neville Nazerane

Reputation: 7039

pass parameters with space in batch file

Let's say I have a batch file named hello.bat that takes two parameters.

According to the answer here: passing a second parameter in a batch file, I can use the following to pass two parameters using powershell:

start-process hello "test test2"

Now, considering that the two parameters are separated by space, how would I pass a parameter with a space. For instance what if the first parameter was test one instead of test? I have tried start-process hello "test","test 2", does not seem to work.

Upvotes: 1

Views: 1705

Answers (1)

Compo
Compo

Reputation: 38664

You could try adding double doublequotes like this:

start-process hello """test one"",test2"

Hope this helped you out!

Upvotes: 1

Related Questions