node-auto-launch icon indicating copy to clipboard operation
node-auto-launch copied to clipboard

Modify startup status on Windows

Open MadLittleMods opened this issue 9 years ago • 4 comments
trafficstars

Currently auto-launch will add/delete a registry key to add it to the startup list. WIndows also seems to remember what the status that was set between adding/removing from the startup list which probably means that it is a separate registry key entry somewhere else.

Can we change the startup status to Enabled/Disabled if the key already exists?


API-wise, the default for the enable/disable methods would probably be setting the status if it already exists, and then pass a "hard" option in to delete it from the startup list.

// Set the status to `Enabled` if it already exists
// Otherwise create the entry
autoLaunch.enable();
// Set the status to `Disabled`
autoLaunch.disable();
// Remove from startup list
autoLaunch.disable(true);

MadLittleMods avatar Feb 10 '16 02:02 MadLittleMods

I would love to be able to implement this but haven't been able to find any mention of how to accomplish it with registry keys. If anyone has an ideas on how to go about this it would be great to get your input.

Thanks for the suggestion!

4ver avatar Apr 04 '16 15:04 4ver

One way would be with HKLM/SYSTEM/CurrentControlSet/Services or making a new service with services.msc . But both would bring the UAC up

berryelectronics avatar May 02 '16 19:05 berryelectronics

Using process monitor while disabling / enabling items inside the task manager led me to the following registry:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\{application_name}

It seems to hold binary data of 02 00 00 00 00 00 00 00 00 00 00 00 when enabled, and... something else when disabled. Looks like when disabled, the binary always starts with 03 00 00 00 ... followed by varying hex, changing based on which application is being disabled, I think. I'm not sure why, or what the disabled binary is supposed to represent.

Found some additional information here: http://superuser.com/a/664672

dvlsg avatar Jun 01 '16 18:06 dvlsg

worth to mention that - at least for me - this is not an issue with win7 but with win10

black-snow avatar Jun 08 '16 12:06 black-snow