Can I set order of apps that run at startup?

Page 2 of 2 FirstFirst 12

  1. Posts : 1,767
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #11

    Using just the command console (cmd.exe), it's not possible to hide the output window completely, only minimize it.

    So, for example, say you have a batch file like C:\Support\MyBat.bat.

    You can create a shortcut to C:\Support\MyBat.bat then amend the shortcut's properties to run the BAT file minimized... so all you see is a flash of the output window in the taskbar. The shortcut would be along the lines of:

    Code:
    START /MIN "My Title" "C:\Support\MyBat.bat"

    Alternatively you can make your batch file minimize itself by adding either of the two following commands to the beginning of the batch file:

    Code:
    CONSOLESTATE /Min

    or

    Code:
    SETCONSOLE /minimize

    To make the console truly invisible, you'll need to invoke your batch file from another language. For example, I use AutoHotkey so, to run a BAT file with no visible output window, I could use a one-line AHK script... something like this:

    Code:
    Run C:\Support\MyBat.bat, , Hide

    Note that I don't have to invoke cmd.exe specifically... it's implicit by the use of .bat as a filetype.

    If I DID need to invoke cmd.exe then I would use something like this:

    Code:
    Run, %ComSpec% /c C:\Support\MyBat.bat, , Hide

    Either will work... it's just that the use of cmd.exe is implicit in the first example and explicit in the second.

    Note that you can also use scripting languages like VBS (built-in to Windows) to run BAT files hidden:

    Code:
    Set oShell = CreateObject ("Wscript.Shell") 
    Dim strMyStart
    strMyStart = "cmd /c c:\support\mybat.bat"
    oShell.Run strMyStart, 0, false
    Here the last line's second parameter (0) is the flag for 'hidden'.

    Hope this helps...

    EDIT: My apologies. As I mentioned in an earlier post, it's been more than a decade since I last wrote a batch file... and, in the meantime, it appears that both CONSOLESTATE and SETCONSOLE have been deprecated. My fault for not testing before posting. Mea culpa...
    Last edited by RickC; 06 Nov 2020 at 21:35.
      My Computer


  2. Posts : 526
    Windows 10 (22H2)
       #12

    ^
    awesome - thanks so much Rick
      My Computer


  3. Posts : 526
    Windows 10 (22H2)
       #13

    ... startup shortcut is here:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
    Attached Thumbnails Attached Thumbnails Can I set order of apps that run at startup?-screenshot-2020-11-06-162824.png  
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:23.
Find Us




Windows 10 Forums