Windows 10: HKLM Run key doesn't seem to be triggering on W10 - but works on W7 Solved

  1.    24 Jan 2018 #1

    HKLM Run key doesn't seem to be triggering on W10 - but works on W7


    Hello folks.

    I could use a sanity check on this one. I've got an AutoIt EXE that I've built to accomplish a couple of simple tasks, and I need this to run when a user logs into the machine. So I've got the EXE tucked away at "C:\Windows\Temp\EXEname.exe"

    I've got a registry value in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run to launch the EXE. On Windows 7, this runs without an issue - on Windows 10, following a reboot the key doesn't seem to be triggered. There are no other Run or RunOnce keys in HKLM\SOFTWARE or HKLM\SOFTWARE\Wow6432Node.

    A couple of things I've tried verifying
    • The path in the registry value is correct - I can launch the EXE from this path manually
    • The EXE is not being launched by Windows (verified through observance and use of procmon)
    • I've tried manually granting full control on the C:\Windows\Temp to a user account for testing and then logging in with that user to verify it's not a permissions issue.


    Any other ideas for troubleshooting, or any ideas on changes between W7 and W10?
      My ComputerSystem Spec

  2.    24 Jan 2018 #2

    Hi, I note:
    There are no other Run or RunOnce keys in HKLM\SOFTWARE or HKLM\SOFTWARE\Wow6432Node.
    I have some entries there, but of course it depends what you have installed:
    Click image for larger version. 

Name:	1.jpg 
Views:	31 
Size:	77.2 KB 
ID:	174005

    - but all that says is, well, surprise, they're used in Win 10 as you'd expect.

    You could try putting a shortcut here:
    C:\Users\-name-\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    or here
    when a user logs
    = any
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
      My ComputerSystem Spec

  3.    24 Jan 2018 #3

    dalchina said: View Post
    Hi, I note: C:\Users\-name-\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
    Thanks for the reply!

    I need this to run for all users - so C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup would be a better option - however, I'm more concerned with determining why this key isn't firing off when it should, as opposed to finding another way to launch the EXE.
      My ComputerSystem Spec

  4.    24 Jan 2018 #4

    Suggest you post a screenshot of your reg. key.

    Is the entry still there after you reboot?
      My ComputerSystem Spec

  5.    24 Jan 2018 #5

    If you mean here:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	1 
Size:	23.7 KB 
ID:	174017

    The HKLM, "Software\Microsoft\Windows\CurrentVersion\Run(or RunOnce) definitely work under Windows 10. I in fact changed the authority to read only so Windows 10 would not be able to add (and then re-open) apps after a restart which is something I don't like.

    If it isn't running make sure you are doing restart not shutdown. If that works then turn off fast startup and/or check authority on the keys.

    It works the same as in 7 (or at least it should). Make sure your .exe isn't trying to run under admin privileges - that will not work (but I don't think it did in 7 either).
      My ComputerSystem Spec

  6.    24 Jan 2018 #6

    You just need an Elevated Shortcut in your startup folder.

    Click image for larger version. 

Name:	start-up.jpg 
Views:	16 
Size:	33.2 KB 
ID:	174042
      My ComputerSystem Spec

  7.    24 Jan 2018 #7

    Callender said: View Post
    You just need an Elevated Shortcut in your startup folder.
    You could. Or you could schedule it through Task Scheduler. Depends what you want to do.

    If the OP wants it to be for all users it would have to be %ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp
    not %appdata%\Microsoft\Windows\Start Menu\Programs\StartUp though.

    In any case, any of these methods will only work if your user is part of the Administrators group. You can't run Admin tasks for a standard user at logon or startup. The OP hasn't said if the exe requires admin rights and if the user is a standard or admin user although I read from "a simple task" "when a user logs on" it doesn't require admin rights and is for any user (not just a specific one).

    In that case sticking a value "Whatever" with Value Data "C:\Temp\Whatever.exe" in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run should definitely work (it does for me).

    The only issue I can think is the OP is using C:\Windows\Temp\Whatever.exe and perhaps C:\SomewhereElse\Whatever.exe would be better (i.e. not using the Windows directory). That is only a guess though but sticking an exe in a temp folder seems a bit weird as a long term solution as something like Disk Cleanup would presumably delete it eventually.
      My ComputerSystem Spec

  8.    24 Jan 2018 #8

    We'll know more if @FlatJackBob posts a screenshot- a bit more info.
      My ComputerSystem Spec

  9.    24 Jan 2018 #9

    For clarification, this wasn't an issue of "we have no Run/RunOnce keys" or "none of our Run/RunOnce keys work" it was an issue with a specific Run key for an app that was developed in-house.

    lx07 said: View Post
    If you mean here:
    It works the same as in 7 (or at least it should). Make sure your .exe isn't trying to run under admin privileges - that will not work (but I don't think it did in 7 either).
    I discovered this to be the issue before heading out for lunch today. We run a locked down image in our labs which has UAC disabled on W7. While we have neutered its ability to notify users on W10, we haven't fully disabled it. While we have it set to Never Notify, we don't want to break any of the Win10 apps, so we can't modify the EnableLUA registry value.

    In this instance, the AutoIt EXE we crafted required admin rights to properly detect elements inside a software installer GUI. Since UAC was disabled on 7, it would elevate itself and run. On 10, we were running into UAC not displaying a notification (as our settings intended) but even though an Administrator was logging in, they weren't trying to run the program specified by the key as an Administrator.

    After working out the cause of the issue we elected to go with a scheduled task that was configured to run the EXE with the highest level of permissions available when a user logs in. Almost all of our software is deployed during the initial rollout of a machine while an Administrator service account is logged in, so things are running smoothly. Well, as smoothly as they can when a software vendor decides to address HIPAA compliance issues by building a new version of their software that cannot be traditionally deployed.
    lx07 said: View Post
    You could. Or you could schedule it through Task Scheduler. Depends what you want to do.
    The only issue I can think is the OP is using C:\Windows\Temp\Whatever.exe and perhaps C:\SomewhereElse\Whatever.exe would be better (i.e. not using the Windows directory). That is only a guess though but sticking an exe in a temp folder seems a bit weird as a long term solution as something like Disk Cleanup would presumably delete it eventually.
    As mentioned above, this EXE was built as a helper for deploying a PITA installer for software that can no longer be automated by command line switches, is on too many workstations for us to push manually, and for reasons chosen by the software developers cannot be recaptured (securely) into an MSI with a product like AdminStudio. We've got this helper self-deleting upon a successful completion, and as you've mentioned it would be cleaned up automatically as we run Disk Cleanup at the tail end of our machine rollout.
      My ComputerSystem Spec


 

Related Threads
I have a Lenovo Type 7663-CTO laptop that had Windows 7 x64 Ultimate on it. I have a 32 gig Lexar thumb drive that worked with this laptop. Then I did a clean install of Windows 10 x64 Pro and have all the drivers updated to the latest (latest...
1. Sfc /scannow does not work...........Windows Resource protection could not start the repair service. 2. Dism /online /cleanup-image /restorehealth works. 3. Safe mode does not work. Once got to safe mode, the screen kept...
OK, please bear with me: I'm not a newbie and not ignorant of basic Windows parameters but neither do I consider myself an expert - hence seeking your generous help! I am running as TESTADMIN, an account which is a member of the Administrators...
Workgroup works yet doesn't in Network and Sharing
I have 3 pc's in my LAN Mark= Win7 32 bit Dave= Win10 32 bit HTPC = Win10 64 bit I'm trying to share the files on HTPC and have created a workgroup. Dave and Mark can share files Mark and HTPC can share files But Dave who can connect to...
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:00.
Find Us