Yon P
Yon P

Reputation: 206

Command in cmd works but when I try to use Python it says 'is not recognized as internal or external command'

running cmd with python

Hi, I have uploaded a picture showing my problem. Whenever I try to issue the command 'runpkr00' in cmd.exe, the program runs fine and smooth.

runpkr00

however, if I try to open cmd with Python and write the same code, I get the error as 'not recognized as internal or external command'

>>>import os
>>>os.system('cmd')
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

`C:\Python35>runpkr00`
'runpkr00' is not recognized as an internal or external command,
operable program or batch file.

I have checked my ENVIRONMENT VARIABLESthat I have C:\Windows\System32, `%SYSTEMROOT%\system32 .

Are there any other solutions for this? I am running Windows 8.1 Single Language 64bit.

PS. If I try to input ipconfig instead of runpkr00, both are working.

Upvotes: 1

Views: 1121

Answers (1)

Yon P
Yon P

Reputation: 206

Well as I stated that my problem is that if i run cmd simply in windows, I can run the .exe file. But if I run cmd with Python, it gets lost somewhere.

What I did was to edit my path variables. I wrote down C:\Windows\SysWOW64' insidepathand also placed a copy of myfile.exeinside theC:\Windows\SysWOW64` directory. Fortunately enough, this got it working. Thank you for helping.

Upvotes: 1

Related Questions