You most likely got windows installed on another drive or the search path for the commandprompt is located elsewhere, hence why it can't find it.
You should be able to use the very same code if you replace the path inside the post with your own search path.
I'd say you should check where your windows is installed first. If it turns out to be on the C: drive, try looking if the path Windows\System32\cmd.exe actually works, if not, find where you get to your cmd.