How To Automaticaly Start A Program Minimized

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 31,468
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #11

    Chris Nicola said:
    In any case, I have UAC turned off.
    Glad to have helped you get it working. If you had UAC turned off just to try to get this working, I'd turn it back on now. It's there to prevent malware making changes without your permission.
      My Computers


  2. Posts : 140
    Windows 10
    Thread Starter
       #12

    Thanks for the advice. Actually I had it turned off for other reasons. I just turned UAC back on to the default settings and rebooted to test what would happen with Task scheduler and I am not getting any alerts which is fine. Thanks again.

    Kind regards
    Chris
      My Computer


  3. Posts : 3
    Windows 10
       #13

    For running the program minimized using the cmd.exe /C start /MIN, the focus of the window still changes since the first cmd.exe is launched in a real window. You can avoid this by using the vbscript with WScript.exe:

    1. Create a .vbs script to the folder/name of your choice, I use startprocess.vbs in my example.
    Code:
    Option ExplicitDim oShell 'WScript.Shell objectDim iOption 'WScript.shell.run visibility option'For iOption, see https://technet.microsoft.com/en-us/library/ee156605.aspxSet oShell = CreateObject("WScript.Shell")If WScript.Arguments.Count >0 Then    If WScript.Arguments.Count > 1 then        iOption = CLng(WScript.Arguments.Item(1))        oShell.run WScript.arguments.item(0), iOption    Else        oShell.run WScript.arguments.item(0)    End IfEnd If
    2. Create launcher for the script to run your program
    wscript.exe /B /NoLogo [path]/startprocess.vbs "your command here with parameters" 7
    e.g. wscript.exe /B /NoLogo "C:\Windows\System32\cmd.exe /C MyStartup.cmd > C:\Temp\MyStartup.log" 7
    Now you can place the launcher to the Windows Task Scheduler (or any other place) and your command with parameters will be run minimized without changing the focus of the windows i.e. your work is not affected by the running process. This is due to the fact that wscript.exe does not create any windows when run with the batch mode with /B option.

    Script does not contain any error handling or other additional stuff.

    What the script does it uses the first argument (if it exist) as a full command line for launching the command and the second parameter as WShell.exec visibility option (Microsoft Windows 2000 Scripting Guide - Running Programs)

    When using with the Windows Task Schedule, you place
    C:\Windows\System32\wscript.exe
    as executable and the rest of the parameters as arguments, in my example
    /B /NoLogo "C:\Windows\System32\cmd.exe /C MyStartup.cmd > C:\Temp\MyStartup.log" 7
      My Computer


  4. Posts : 140
    Windows 10
    Thread Starter
       #14

    Thank you very much for this detailed explanation. Another solution Bree found was to add the argument "/background" in task scheduler.

    Kind regards
    Chris

    How To Automaticaly Start A Program Minimized-desktop-20secretary-20task-20scheduler.jpg
      My Computer


  5. Posts : 3
    Windows 10
       #15

    There was a mistake in startup, the actual script was missing from command line:
    When using with the windows Tas Scheduler, you place
    C:\Windows\System32\wscript.exe
    as executable and the rest of the parameters as arguments, in my example
    /B /NoLogo path\startprocess.vbs "C:\Windows\System32\cmd.exe /C MyStartup.cmd" 7

    In the example I initially used the redirection of stdout to a log file (> C:\Temp\Mystartup.log) which is optional of course.

    mananas said:
    When using with the Windows Task Schedule, you place
    C:\Windows\System32\wscript.exe
    as executable and the rest of the parameters as arguments, in my example
    /B /NoLogo "C:\Windows\System32\cmd.exe /C MyStartup.cmd > C:\Temp\MyStartup.log" 7
      My Computer


  6. Posts : 1
    Windows 10 Pro
       #16

    I want to start a program (Zotero) minimized, so I tried the bat file approach with a single line:

    start /min "C:\Program Files (x86)\Zotero\zotero.exe"

    and it failed to start at all. I went to Command Prompt and tried

    C:
    start /min "Program Files (x86)\Zotero\zotero.exe"

    and, surprise, it didn't work there either! It simply creates and minimizes another C: command prompt window (if I start without the /min, it opens the C: window). The only thing that worked was to navigate to the final directory, and then it started, minimized or not. So the final working bat file is:

    C:
    cd "Program Files (x86)\Zotero"
    start /min zotero.exe

    I tried the same sequence of tests with another program, and the same thing happened.

    I'm happy with the solution, but does anyone have any idea what's going on?

    Cheers!

    Ed
      My Computer


  7. Posts : 3
    Windows 10
       #17

    pafnooty said:
    I want to start a program (Zotero) minimized, so I tried the bat
    Cheers!

    Ed
    This is by desing of the start program. Start ["title"] program
    If the first parameter has quotes, it is assumed title.
    Try editing your command to

    start /min "" "Program Files (x86)\Zotero\zotero.exe"
      My Computer


  8. Posts : 1
    Win 10 Pro
       #18

    Hello, this thread has helped me with a recent app from my mouse (Mars Gaming MM018) running on win10, the app has no startup options so i created a task to run it with high privileges and skip the yes/no UAC question.
    Can you please help me out finding the argument to have it minimized to tray?
    (the app close button on top corner minimizes to tray)
      My Computer


  9. Posts : 168
    10 (1909)
       #19

    Hi!

    I tried starting stupid messenger minimized, but all the command lines suggested here failed.
      My Computer


  10. Posts : 56,806
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #20

    avada said:
    Hi!

    I tried starting stupid messenger minimized, but all the command lines suggested here failed.
    If you're using a shortcut, have you tried this?

    Example:

    How To Automaticaly Start A Program Minimized-2021-04-26_11h49_10.png
      My Computers


 

  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:57.
Find Us




Windows 10 Forums