0

Hey I've got a quick question,

I know that you can start applications minimized through the command prompt with something like:

start /min "" "C:\Windows\notepad.exe"

However is there a way to automatically close the window, now I don't mean kill the process/task. Just close the window. In notepads case this would work the same way as killing the process, but in something that will minimize to a system tray on a window close, like Skype, or Discord for example this wouldn't kill the process but instead just put the task away from sight.

Thanks

  • Yes, right after the application has launched, just close it. So you'll only see it very briefly and then it will disappear – Sam Campbell Feb 12 '17 at 14:53
  • I suppose this is a very specific request, however the app I am trying to minimize will essentially ignore any minimize or start silent command because it has a splash screen. So if I start it minimized this will only minimize the splash screen and still boot the application in fullscreen – Sam Campbell Feb 12 '17 at 15:01
  • Would it be possible to use one of the 'key recording apps' to record a `macro` that is then used to start the application minimized? – Ryan Vincent Feb 12 '17 at 15:15
  • You could use a key recording app like @RyanVincent suggested or you could launch it hidden completely using a VBScript - http://stackoverflow.com/a/22700462/5269570 – Sam Denty Feb 12 '17 at 18:33
  • You opted for the wrong solution due to wrong assumptions. Closing a window is a destructive operation. The window is gone, but the process is also broken, if it doesn't expect random programs killing their windows. – IInspectable Feb 12 '17 at 20:39

1 Answers1

0

This is not possible in batch files alone, instead this script creates a temporary VBScript at %temp%\hidden.vbs and then passes arguments to it using wscript.exe


This script doesn't minimise it or send it to the system tray, it just hides it and is only visible in Task Manager

@echo off
(echo CreateObject^("Wscript.Shell"^).Run """" ^& WScript.Arguments^(0^) ^& """", 0, False) > "%temp%\hidden.vbs"
set launch=wscript.exe "%temp%\hidden.vbs"


%launch% notepad
Sam Denty
  • 3,693
  • 3
  • 30
  • 43