Coursal
Coursal

Reputation: 1387

C++ ':chcp' is not recognized as an internal or external command, operable program or batch file

(Before the question: I would appreciate if someone wouldn't flag this thread as a duplicate because as much as I searched there wasn't anything close to my problem, only other programming languages and compilers or different OS's)

I'm using Dev C++ and I was after debuging a program with greek characters (system("chcp 1253");)at the output, but when I ran it, all the characters were unreadable and this message above was seen:

enter image description here

Based on some pretty close questions on the web (here and here and here) I though that my path was also broken, so I checked it out with "check chcp" on cmd, where it showed the proper path (c:\Windows\System32\chcp.com).

screenshot here

Has anyone else has come up with the same issue?

Upvotes: 1

Views: 3499

Answers (1)

Coursal
Coursal

Reputation: 1387

To re-set the path of chcp to the compiler, I simply had to type the whole path from the Windows folder into my program:

system("C:\\Windows\\System32\\chcp.com 1253");

This also works without the full path:

system("chcp.com 1253");

And then I had to get rid of the ".com" portion of it, making it:

system("chcp 1253");

Still, kind of a work-around but time-saving and risk-free.

Upvotes: 1

Related Questions