title: How to hide terminal shell on server application like Warp in Windows?
body: <p>I have a small <code>warp</code> server project on Windows that listen to a particular port and do something whenever I send a command to it by REST (for example: <code>POST http://10.10.10.1:5000/print</code>). It's a small client for printing PDF / receipt directly from another computer.</p>
  <p>It works. But my problem is when I had to <code>package</code> the whole project, the Rust compiler give me an executable file (.exe). The application displays a terminal window when I run it. I want this terminal to be hidden somehow.</p>
  <p><a href="https://i.stack.imgur.com/zHnbP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zHnbP.png" alt="Terminal that I want to get rid of" /></a></p>
  <p>I try to run the program as a windows service (by using NSSM). It doesn't work for me since I had to access the printer. Windows doesn't allow my app to access any devices or any other executable as a windows service. (The reasons are explained here: <a href="https://stackoverflow.com/questions/5307968/how-can-i-run-an-exe-program-from-a-windows-service-using-c/55628635?answertab=scoredesc#tab-top">How can I run an EXE program from a Windows Service using C#?</a>)</p>
  <p>So I plan to run my app as a tray-icon application so user can control or close the app. (<a href="https://github.com/olback/tray-item-rs" rel="nofollow noreferrer">https://github.com/olback/tray-item-rs</a>)
  Unfortunately, I still cannot hide the app's terminal window.</p>
  <p>Another solution that I found is <code>hstart</code> (<a href="https://www.ntwind.com/software/hstart.html" rel="nofollow noreferrer">https://www.ntwind.com/software/hstart.html</a>). But I would like to use this as &quot;the last resort&quot; solution since many antivirus/windows defender mark it as a malware.</p>
  <p><a href="https://i.stack.imgur.com/hTdPe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hTdPe.png" alt="Try to have a tray app like this" /></a></p>
  <p>Do anyone know how to hide or get rid of it ?</p>