Want to run applications minimized at log in from Task Scheduler

Rhonda the Sly

Senior member
Nov 22, 2007
818
4
76
Hmmmm, seems my title was too good and I have no material left for the body...

So, how would I go about starting an application minimized in Task Scheduler? I'd like to avoid simply creating shortcuts set to [Run: Minimized] if I could.
 

Rhonda the Sly

Senior member
Nov 22, 2007
818
4
76
...I know I left them somewhere...

...Ah, here they are.

!

Don't mind me, I just dropped my keys.
 

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
Couldn't you do this with a bat file or something. Granted it wouldn't be much more than doing the Shortcuts with a command line param, but if there is more than 1 item you can stick them all into 1 bat file and not have multiple short cuts floating around.
 

KB

Diamond Member
Nov 8, 1999
5,397
384
126
If you want something to run at login you can put it in the Startup folder in the start menu.

I would use a batch file as Bobross said and have it run the program using the start command:

start /MIN C:\programname.exe
 

Rhonda the Sly

Senior member
Nov 22, 2007
818
4
76
Couldn't you do this with a bat file or something. Granted it wouldn't be much more than doing the Shortcuts with a command line param, but if there is more than 1 item you can stick them all into 1 bat file and not have multiple short cuts floating around.

If you want something to run at login you can put it in the Startup folder in the start menu.

I would use a batch file as Bobross said and have it run the program using the start command:

start /MIN C:\programname.exe
I'm trying to avoid throwing too many files around my system (not because of the lost ~400KB :p) so I stopped the using the Startup folder. I figured there just had to be a better way, and lo and behold... there was. So, I made a bat file and tossed it away but I have one small issue: Windows Live Photo Gallery won't open minimized. Many of my applications (WMP, Zune, CS3, VB2008, FF3, WLM, and more) have no problem opening minimized but WLPG just doesn't seem to like the idea. WLM when opened minimized doesn't opened minimized the tray, too. Everything else is acting just as expected, so I guess its a learning experience that I'll work around. Thanks bobross419 and KB.
 

bobross419

Golden Member
Oct 25, 2007
1,981
1
0
You could try going to the program file itself using the explorer then Right click >> Properties and change the "Run" field from Normal Window to Minimized.

Most apps should have this option on XP, I don't know if this will be different on Vista. If you do this though it will always open minimized even when you open it manually instead of opening through the startup process.

-----

Edit - Nevermind the above, I was playing with shortcuts and not the direct application files themselves. If you've already got a shortcut on the desktop you could try using the Open Minimized command that way.
 

Mananas

Junior Member
Nov 8, 2017
1
0
1
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 Explicit
Dim oShell 'WScript.Shell object
Dim iOption 'WScript.shell.run visibility option
'For iOption, see https://technet.microsoft.com/en-us/library/ee156605.aspx
Set 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 If
End 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 (https://technet.microsoft.com/en-us/library/ee156605.aspx)

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