Display $cmd to the screen so you can see what you've put together. Might it be that you don't have the path to the exe?