Fix issue that kill cmd on Windows
Fix cwd on Windows
Merge pull request #4147 from UtahDave/develop

Fix issues with cmd module and states on Windows.