Windows 10 - Can you run and close a program automatically at startup?

1Wolf

Limp Gawd
Joined
Jul 10, 2007
Messages
417
Windows 10 question....

I have a little problem with a piece of software I was hoping someone might have a slick solution for.

My system has a few sets of the Lian Li SL120 UniFans. The "default" for the fans is just an RGB rainbow. There is a configuration program for them called "L-Connect" where you can set the RGB colors, effects, etc. You can open L-Connect, set your effects/colors, then close the program completely and the fans will maintain those effects/colors you set. When you click "X" on the program it closes to the system tray. Then you can right click in the system tray and choose "Exit". However, if you shut down and power off completely (Remove power from the system) then when you boot back up the fans will default back to the default "Rainbow" RGB. In order to restore them to what you had set up, once in windows you need to open the L-Connect software again...and then just close it. Then you can either leave it running in the system tray or right click and select "Exit".

The L-Connect software...is...well....bad. Its the only software I've ever seen like this with absolutely no "settings" panel, no checkbox to be able to run it at startup, and no checkbox to be able to run it in the system tray.

If I use "shell:startup" from the command line and add the shortcut for L-Connect to the startup folder....that does work. However, once windows comes up and L-Connect runs....of course it still has its window open and sitting there at the desktop so I have to go and manually click "X" on the program to "close" it to the system tray. It works, its just stupid and cumbersome.

Is there a better way to do this? Is there a way to have windows run it at startup, and then close it? Or is the only option waiting for Lian Li to create an update for their software that provides a "minimize to system tray" checkbox and a "run at startup" checkbox.
 
Last edited:
Joined
Apr 29, 2002
Messages
2,514
Write a start, pause, taskkill script and put that in your startup routine?

Something like:
Start c:\lianli\programname
timeout /t 10 /nobreak
taskkill /im "programname" /f
 
  • Like
Reactions: 1Wolf
like this

slavie

Weaksauce
Joined
Jan 2, 2012
Messages
126
Yep, small .bat script. Then in add your newly created shell script to the start menu startup folder and disable the lianli utility from auto start. Might have to fiddle around with it a bit, but that should do it.
 
  • Like
Reactions: 1Wolf
like this

dbwillis

Supreme [H]ardness
Joined
Jul 9, 2002
Messages
8,052
turn it into a service, isnt there a PS something to install an app as a service?
 
  • Like
Reactions: 1Wolf
like this

pendragon1

Fully [H]
Joined
Oct 7, 2000
Messages
28,217
one of those^^^ or you could try to set it to run minimized and just plop it in your startup items
1617044980909.png
 
  • Like
Reactions: 1Wolf
like this

1Wolf

Limp Gawd
Joined
Jul 10, 2007
Messages
417
Thanks for the help.

Let me clarify a bit. When you open the L-Connect application and then click the "X" in the upper right corner the application will "close" to the windows notification area. Its one of those applications that is coded so that when the user clicks "X" it goes to the system tray instead of either shutting down completely or minimizing. There is no settings or options for the program.

If I go to shell:startup and add a shortcut to the program there, then L-Connect will run just fine when windows starts. The problem is that it leaves the window open.

What I want to do is this...

Have the program run at startup JUST as it is now using shell:startup...only I'm trying to automate clicking on the "X" to close the program to the notification area. That way the window doesn't sit there open in the middle of the screen until the user closes it and they can open the notification area to find the little icon there and close it there if they wish.

Write a start, pause, taskkill script and put that in your startup routine?

Something like:
Start c:\lianli\programname
timeout /t 10 /nobreak
taskkill /im "programname" /f

Thank you! That works well. This is my second option as it will kill the process completely. My issue isn't really that the program is running but that its in this window that has popped up in the middle of the screen on startup. I was hoping I could automate a click on the "X" to send the program to the notification area. That way I don't need to worry about "timing" or whether the program was open long enough to actually configure the fan profiles. I just don't want this window popping up in the middle of the screen that the user then has to click the "X". It just seems there should be some way of automating the click of the "X".

Maybe instead of "taskkill" is there something like "windowClose" or something like that which would just close the window but not kill the process?

turn it into a service, isnt there a PS something to install an app as a service?

Hate to say it, but I have no idea what that means. I've never installed an app as a service and am not sure if that would solve my issue or not.

one of those^^^ or you could try to set it to run minimized and just plop it in your startup items
View attachment 343318

Thans pendragon1. I did try that. It ran L-Connect at startup but then just minimized it to the taskbar. Instead of minimizing to the taskbar I'd much prefer clicking the "X" so that it goes to the notification area.
 

Tentative

n00b
Joined
May 29, 2021
Messages
1
I love the Lian-Li Uni fans, but this problem also frustrated me. I found a solution to this myself that I think you'll be quite happy with, and doesn't require ANY special bat files. I thought this was going to be a necropost, but then realized I was looking at someone's join date, not the post date. Hopefully you find this helpful! I joined the forum specifically to post this solution, hah!

You DO need to use Task Scheduler. The steps are as follows:

  1. Open Task Scheduler and choose Action > Create Task...
  2. Under the General tab, name/describe it and mark the checkbox for Run with highest privileges. Configure for Windows 10.
  3. Triggers tab, click New...
  4. "Begin the task", choose At log on (NOT startup)
  5. Mark the checkbox Stop task if it runs longer than: (type in 30 seconds)
  6. Click OK
  7. Actions tab, click New...
  8. Click Browse... and navigate to where your L-Connect.exe is installed and select it.
  9. Click OK, and then OK again on the Create Task window.
  10. You're done! Completely power off your computer and reboot to test.
This works like a charm for me with my Asus Zenith Extreme II Alpha mobo, and I'd wager it'll work fine for other mobos also. Fun fact: Once the L-Connect software is run once, it doesn't need to stay open for the fans to still sync with the motherboard. I use the Music setting with my Aura Sync, and the fans still work with the motherboard control even though the task scheduler completely closes the L-Connect.exe after running it, so less overhead as a nifty bonus.

Enjoy!

P.S. on their website, it's worth noting that they mention they're working on a 2.0 version adding requested features, so while this solution may work in the interim, keep an eye out for their update, and make sure to remove the task if you ever update.
 
Top