简体   繁体   中英

Compiled exe won't run through my custom schemed cmd?

I have a custom color/font/size/etc. scheme for my cmd.

When I run my program through VS (with or without debugging) it runs my program in cmd using my scheme. (good)

But, when I run the exe file directly, it runs in the default cmd (without my scheme). (bad)

If I make a .bat file which executes my exe, then it runs in the schemed cmd. (good)

But if I make a shortcut of that .bat file, it runs in the default cmd! (bad)

How can I make it so that the exe itself runs through the schemed cmd?

If not possible, how can I make it so the shortcut to the exe/bat runs it through the schemed cmd?

If you want the software to run in schemed cmd, you should execute the program over command line, other way you can edit your program's font etc. in your program.

Compilers run programs by cmd.

And if you want it so much, you can check your program on task manager at beginning your code and if there isn't, you can run with system function and hide first one.

I don't know how you changed your cmd scheme, so, it is possible that this will not help you. Anyway...

The standard way of cmd customization is to include in HKCU\\Console\\ a subkey with the title of the console that will be customized, and inside this key, the values that define the console properties (more here )

So, let's say you have now a console scheme in the registry. When you start a console program via a shortcut, the window title of the started console is the text indicated as the shortcut name. Match shortcut name to console name defined in registry (or the reverse).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM