Hello,
I have written a C# WinForm application. I have put the .exe in the Program Files (x86) folder.
Later in the registry "COMPUTER\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WINDOWS\CURRENTVERSION\RUN" I have put my application
Value Name : ABC
Value Data : "C:\Program Files(x86)\ABC\ABC.EXE"
- RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
- rk.SetValue("ABC", "\""+ Application.ExecutablePath + "\"" );
Is there any chemical change to registry in Win 10 for applications to load on startup ? Where am I heading wrong..??
FYI :
1. User Access Control is turned off on Win 10
2. I have also tried "Current User" instead of "Local Machine" both seem to revolt from working.
Thanks for trying to help.
Laxmidhar SahooPosted Nov 8, 2018, 10:25 PM
tvkswamyPosted Nov 8, 2018, 12:56 PM
Hello,
Resolved.
The problem was in the app.manifest.
Once I remarked this line, the application started working on system startup.
Though my Windows User Id belongs to the Administrator group, the application does not run on startup as Administrator unlike in Win 7. Not sure why.
I remarked the line above (app.manifest) and elevated my level of access in code (to run as administrator) using the piece below
And it now works !!
Happy Coding.
Amit GuptaPosted Nov 6, 2018, 5:33 AM
Jack VolterPosted Nov 6, 2018, 5:22 AM