I would put the command that is to be SHELLed out into a string first. Then you can do a
code:
$shellcommand='%COMSPEC% /e:1024 /c ECHO Whatever'
? $shellcommand
shell $shellcommand

and look at the string. It might help to find out why it's not working by then typing in the command manually in a DOS prompt.
_________________________
There are two types of vessels, submarines and targets.