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

I use the following command to launch new ConEmu powershell consoles.

ConEmu64.exe /config "shell" /dir "c:\" /cmd powershell -new_console:n

I would like to pass an additional argument to specify a powershell script to run at startup of a new console. The following almost works but only prints the whole command and does not actually execute it:

ConEmu64.exe /config "shell" /dir "c:\" /cmd 'powershell -noexit -Command {Write-host "Hello world"}' -new_console:n

which produces:

Write-host Hello world

while I am expecting:

Hello world
share|improve this question
up vote 3 down vote accepted

Remove single quotas around your command. ConEmu executes intact string (command) which follows /cmd switch, with only exception - all -new_console... and -cur_console... are removed from this string before starting console.

ConEmu64.exe /config "shell" /dir "c:\" /cmd powershell -noexit -Command Write-host "Hello world" -new_console:n
share|improve this answer

Ok Figured it out, its a quoting issue, but there is still some weirdness going on:

/config "shell" /dir "c:\" /cmd 'powershell -noexit -Command "& Write-host `"Hello world""' -new_console:n

That works and produces the expected:

Hello World

but if you look carefully the quote at the end of "Hello World" is not escaped while the first one is. If I use the seemingly correct syntax:

/config "shell" /dir "c:\" /cmd 'powershell -noexit -Command "& Write-host `"Hello world`""' -new_console:n

I get

Hello world`
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.