Pkg: Console window

Created on 13 Dec 2017  路  3Comments  路  Source: vercel/pkg

How do I prevent a console window opening when I run my exe?

Most helpful comment

@BernardoLaing , on Windows, you can set a flag on the exe to ensure it runs without a console window:

editbin /subsystem:windows myprogram.exe

editbin on my machine is located at c:\program files (x86)\microsoft visual studio\2019\Preview\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x86\editbin.exe (I'm using VS 2019)

Note running the edited app in through a console will not produce output unless you explicitly pipe it (e.g. myprogram.exe | type)

All 3 comments

Nodejs always opens a console window. This behavior is related to the target image and you can't change it unless you recompile the target image with this option disabled.

Nonetheless, this link has some nice insights to workaround this: http://www.robvanderwoude.com/battech_hideconsole.php

Having the node application, what options can I set so the console windows does not show?

@BernardoLaing , on Windows, you can set a flag on the exe to ensure it runs without a console window:

editbin /subsystem:windows myprogram.exe

editbin on my machine is located at c:\program files (x86)\microsoft visual studio\2019\Preview\VC\Tools\MSVC\14.20.27508\bin\Hostx86\x86\editbin.exe (I'm using VS 2019)

Note running the edited app in through a console will not produce output unless you explicitly pipe it (e.g. myprogram.exe | type)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

telunc picture telunc  路  4Comments

asaf050 picture asaf050  路  3Comments

Nisthar picture Nisthar  路  4Comments

ksmithut picture ksmithut  路  4Comments

Nilesh0101 picture Nilesh0101  路  4Comments