Reputation: 13971
I have developed an application which will run at system startup.
And it is working fine at system startup,i could see the application in System Configuration -> Startup
.
All the applications shown at Startup can be enabled / disabled.
But my question : is it possible to make an application which cannot be disabled at Startup ?
How are Startup properties controlled in registry?
The image shows an application which cannot be disabled at startup.
On Apply it gets enabled again.
Upvotes: 1
Views: 1661
Reputation: 776
You can create/delete/list startup programs with wmic
on the command line. For example if you wanted to get a list of all startup programs in html format you could run wmic startup list /format:htable > startup.html
at the command prompt and then open the resulting file in a web browser. You can also get the table in CSV (wmic startup list /format:csv > startup.csv
) or a variety of other formats.
There are also the Create and Delete options for use. I'm sure you can use System.Diagnostics.Process.Start
in VB.NET or C# with the appropriate arguments to accomplish your goal. Good Luck!
Upvotes: 1
Reputation: 127
The Simple answer. You cannot.
However, you can hide your startup program from the user (MSConfig) and make it more difficult to disable. Take a look at activex startup method for more info
Upvotes: 1
Reputation: 941317
This question seriously screwed-up my machine. I'll write it up as a cautionary tale so nobody will do the same stupid thing I did.
I didn't think the OP's claim that these checkboxes could be disabled was very credible. Never heard of anything like that, surely it would be widely abused if it were possible. Only way it could work is when he's logged-in as a regular user, that's trite, or by removing the modify permission on the registry value for the Admin group. So I decided to just try it, what could possibly go wrong?
Ran Regedit.exe, picked an entry I didn't care about anyway (Intel shovel-ware). Edit + Permissions, broke the inheritance chain first so I could control the permissions on each individual value. Unticked the Full Control option so only Read access remained.
That worked. Went to restore the permissions. And discovered something I didn't know before. These permissions do not apply to the values, they apply to the key. Obvious only in hind-sight, Regedit however does nothing to make this obvious. And I didn't just remove the modify right, I also removed the right to change the permissions again. On all the values.
Oh, horror. I have to fix this damage, somehow, it is going to bomb installers in the future. The only account that still has modify permission is the System account. I'll have to do something frightful at boot time, maybe write a service.
This is a bad, bad idea. If you have any idea how I can easily repair this then please post a comment.
EDIT: I got it back, of sorts, managed to regain control by changing the owner of the key from System to Administrators.
Upvotes: 11