It's all the day that I'm trying to implement a startup feature into my project.
I used Registry key:
//ComputerHKEY_LOCAL_MACHINESOFTWAREWOW6432NodeMicrosoftWindowsCurrentVersionRun (Administrator Rights)
I used Registry key:
//ComputerHKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRun (Administrator Rights)
The code work but when I restart the computer nothing happens.
This is the code I used.
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
registryKey.SetValue("ApplicationService", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MyService.exe"));
I also used Startup folder linked with a shortcut to my .exe location(inside %appdata%).
Unfortunately, it didn't work.
My operative system is: Windows 10 - PRO 1083.
My project has been developed with C#.
Do you know something else?
I need you to figure out that issue !
Thanks in advance for your answers
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…