Jump to content

How to close not kill a window with command prompt?

Mr.Stork

All the tutorials shows how to kill the process, but I just want to close NordVPN window so it goes to system tray (basically pressing the X button).

I don't want to use taskkill /f /im NordVPN.exe command that kills the nord service. Is there any way to do it?

Im using this code:

@echo off
start "" "C:\Program Files\NordVPN\NordVPN.exe" -c -g "Singapore"
exit

 

Link to comment
Share on other sites

Link to post
Share on other sites

Where are you trying to use this? Because you might as well do the same in a desktop shortcut with the same parameters if you are manually starting it. 

If you want to run it at startup you can also do the same with a shortcut and the same parameters. 

There aren't many subjects that benefit from binary takes on them in a discussion.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

You should be able to use start /min to start minimized if the program supports it.

https://stackoverflow.com/questions/23057448/open-program-minimized-via-command-prompt

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Kilrah said:

You should be able to use start /min to start minimized if the program supports it.

https://stackoverflow.com/questions/23057448/open-program-minimized-via-command-prompt

I suspect they are talking about the commandline window that will still be open if they execute the above as a bat. Which is why I recommended they simply use shortcuts with the parameters included. 

 

I could be wrong though so @Mr.Stork it would be helpful if you explain what it is you are trying to achieve and why. Is it that NordVPN remains visible and you want to move it to the tasktray or is what I mentioned above where the commandline window remains open? 

 

Because the reason it closes now is because you execute it from a bat meaning that NordVPN effectively is running as a child process of that commandline executable. When the exit command is executed it therefore does not only close the commandline window but also any process started up through it.  

 

Knowing what you want to achieve and why will help us in giving a better answer 🙂

There aren't many subjects that benefit from binary takes on them in a discussion.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, creesch said:

I suspect they are talking about the commandline window that will still be open if they execute the above as a bat. Which is why I recommended they simply use shortcuts with the parameters included.

 

I could be wrong though so @Mr.Stork it would be helpful if you explain what it is you are trying to achieve and why. Is it that NordVPN remains visible and you want to move it to the tasktray or is what I mentioned above where the commandline window remains open?

 

Because the reason it closes now is because you execute it from a bat meaning that NordVPN effectively is running as a child process of that commandline executable. When the exit command is executed it therefore does not only close the commandline window but also any process started up through it.

 

Knowing what you want to achieve and why will help us in giving a better answer 🙂

 

So my I made a bat file, which starts rainbow six siege, a game along with overwolf app and Nordvpn set to singapore server which lowers my ping a lot. (Sidenote: I don't use the -c -g "Singapore" anymore as the auto connect feature works fine in nord)

 

When Nord starts it's a window which I dont want to see as it already auto connects to my desired server, so I just want it to not clutter my taskbar.

 

@Kilrah I tried using /min and it puts nord in the taskbar, which is better than nothing, but I want to put it in the system tray, as I don't wanna alt tab to it. And as I said before its kinda cluttery.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×