Personal computing discussed

Moderators: renee, Flying Fox, Ryu Connor

 
Topinio
Gerbil Jedi
Topic Author
Posts: 1839
Joined: Mon Jan 12, 2015 9:28 am
Location: London

How to trigger events on login

Wed Jan 25, 2017 2:43 pm

I'm seeing 2 issues with Windows 10 (1607 Pro 64b) and high CPU load, for which I have manual workarounds which I would like to automate.

1) Acronis' Acronis Scheduler2 Service: causes lsass.exe (Microsoft) to peg a core and schedul2.exe (Acronis) to eat many CPU cycles indefinitely. An actual service.

2) Portrait Displays' Display Pilot: causes dthtml.exe (Portrait Displays) to peg a core. A start-up item. Provided by HP, Philips, BenQ and probably other monitor vendors.

Both issues seem to occur on a multi-user box when a non-admin user logs in then another user does too.

(1) can be worked around by restarting the service, (2) by killing the process and manually starting the executable.

What I want to do is to have these workarounds happen on any user login, so I don't have to deal with it -- but I'm too ignorant about Microsoft Windows to know where to start: anyone willing/able to enlighten me?
Desktop: 750W Snow Silent, X11SAT-F, E3-1270 v5, 32GB ECC, RX 5700 XT, 500GB P1 + 250GB BX100 + 250GB BX100 + 4TB 7E8, XL2730Z + L22e-20
HTPC: X-650, DH67GD, i5-2500K, 4GB, GT 1030, 250GB MX500 + 1.5TB ST1500DL003, KD-43XH9196 + KA220HQ
Laptop: MBP15,2
 
chuckula
Minister of Gerbil Affairs
Posts: 2109
Joined: Wed Jan 23, 2008 9:18 pm
Location: Probably where I don't belong.

Re: How to trigger events on login

Wed Jan 25, 2017 2:51 pm

I've done similar things in Linux but here's a guide that might help for Windows: http://superuser.com/questions/15596/automatically-run-a-script-when-i-log-on-to-windows
Last edited by Flying Fox on Thu Jan 26, 2017 9:12 am, edited 1 time in total.
Reason: Edit by mod - make link clickable
4770K @ 4.7 GHz; 32GB DDR3-2133; Officially RX-560... that's right AMD you shills!; 512GB 840 Pro (2x); Fractal Define XL-R2; NZXT Kraken-X60
--Many thanks to the TR Forum for advice in getting it built.
 
DancinJack
Maximum Gerbil
Posts: 4494
Joined: Sat Nov 25, 2006 3:21 pm
Location: Kansas

Re: How to trigger events on login

Wed Jan 25, 2017 2:52 pm

So, you might try a batch file with the operations you need in it, and place it in the startup programs folder (C:\Users\Adam\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup on my w10x64 machine) or check into Task Scheduler. Just hit start and type Task Scheduler. I bet you can figure it out for the most part.
i7 6700K - Z170 - 16GiB DDR4 - GTX 1080 - 512GB SSD - 256GB SSD - 500GB SSD - 3TB HDD- 27" IPS G-sync - Win10 Pro x64 - Ubuntu/Mint x64 :: 2015 13" rMBP Sierra :: Canon EOS 80D/Sony RX100
 
Chrispy_
Maximum Gerbil
Posts: 4670
Joined: Fri Apr 09, 2004 3:49 pm
Location: Europe, most frequently London.

Re: How to trigger events on login

Wed Jan 25, 2017 3:44 pm

The above solutions will work well to treat the symptoms but the root cause of this is likely that they are both stalled on the first user's process because they don't have the permission/privileges they need to complete.

Try changing the service to logon as an administrator (or as system if it needs automatic access to user profile data)

The Display Pilot thing is probably stalled because it is trying to modify device manager stuff and doesn't have the privileges to do so when run as a user. Look in task scheduler and see what settings it's run as (it's likely there with a user logon trigger) and elevate them to run with an admin account. You can also set it to stop the process if it isn't complete within a set time (like 60 seconds). Don't worry about the limited drop-down options. If you type a value W10 will understand it, units can be in anything from seconds to years, and it understands s, m, h, d etc in short form too.

If the task doesn't appear in Task scheduler, disable it using the Startup tab of Task manager (the thing that used to be msconfig) and create a new scheduled task to replace it with more granular control, the elevated permissions of an admin account and force-quit conditions in case it still gets stuck.
Congratulations, you've noticed that this year's signature is based on outdated internet memes; CLICK HERE NOW to experience this unforgettable phenomenon. This sentence is just filler and as irrelevant as my signature.
 
TheRazorsEdge
Gerbil Team Leader
Posts: 219
Joined: Tue Apr 03, 2007 1:10 pm

Re: How to trigger events on login

Wed Jan 25, 2017 3:55 pm

Topinio wrote:
(1) can be worked around by restarting the service, (2) by killing the process and manually starting the executable.

You can assign a login script to each user that does this (either #1 or #2, although #1 is preferred). As an administrator, you can configure the script to run as SYSTEM so it doesn't matter what their privileges are.

The main question is whether this happens only after a login. If it happens repeatedly while the same two users are logged in, then a scheduled task will be better.

Alternatively, you may be able to uninstall or disable the offending applications. It's surprising how many applications install services to enable functionality that the user never wanted in the first place.
 
SuperSpy
Minister of Gerbil Affairs
Posts: 2403
Joined: Thu Sep 12, 2002 9:34 pm
Location: TR Forums

Re: How to trigger events on login

Thu Jan 26, 2017 8:45 am

I'd just disable the services in the service manager and leave it at that. Odds are they apps wouldn't even notice. If they do throw a fit you can always turn it back on and troubleshoot some more.
Desktop: i7-4790K @4.8 GHz | 32 GB | EVGA Gefore 1060 | Windows 10 x64
Laptop: MacBook Pro 2017 2.9GHz | 16 GB | Radeon Pro 560
 
Flying Fox
Gerbil God
Posts: 25690
Joined: Mon May 24, 2004 2:19 am
Contact:

Re: How to trigger events on login

Thu Jan 26, 2017 9:16 am

SuperSpy wrote:
I'd just disable the services in the service manager and leave it at that.

I would do this first if user is not impacted. Not sure if Display Pilot is a service or just an app specified in [HKLM/HKCR]\...\Windows\Run registry. Use Task Manager's "Startup" section to configure if necessary.

If you do need to use scripts and Task Scheduler, place attention to the trigger conditions of "On startup" vs "On logon".
The Model M is not for the faint of heart. You either like them or hate them.

Gerbils unite! Fold for UnitedGerbilNation, team 2630.

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On