Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to run a program with a command line option from the PowerShell prompt, PowerShell ends up mangling the option. Why does this happen? Is there any way to stop it besides enclosing the option in quotes?

For example, from the PowerShell prompt:

PS Microsoft.PowerShell.Core\FileSystem::\\\\mach\share> .\myprog.exe -file=input.txt

myprog.exe ends up getting two arguments:

  1. -file=input
  2. .txt

I need to run it like:

.\myprog.exe "-file=input.txt"


.\myprog.exe '-file=input.txt'

to force it to be one argument. No other shell does this.

share|improve this question
up vote 2 down vote accepted

This is related to the first character of the parameter, ie the -

For example file=input.txt , /file=input.txt and --file=input.txt will probably all work, but not -file=input.txt.

Quite a lot of programs would accept /file=input.txt inplace of -file=input.txt which may allow a workaround.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.