Z
zequion1
Guest
I use Windows 10 64 bits. I want my program to auto-run on system startup and i've tried the standard system, but it won't auto-run. After executing the following code, I look in "System Manager," Start "and the program is found correctly.
In the first execution that I have carried out, the status of the program was "Disabled" and I have enabled it manually. In the rest of the occasions, I have deleted and created the key with the code again and it appeared "Enabled".
The only difference that I have seen when comparing with other programs is that the permissions of my program are: System, MyUser, Administrators and in the rest of the programs are: "All application packages", "All application packages Restricted" , System, Administrators, Users.
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
{
key.SetValue("My Program", "F:\Temp\Program.exe");
}
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
{
key.DeleteValue("My Program", false);
}
Continue reading...
In the first execution that I have carried out, the status of the program was "Disabled" and I have enabled it manually. In the rest of the occasions, I have deleted and created the key with the code again and it appeared "Enabled".
The only difference that I have seen when comparing with other programs is that the permissions of my program are: System, MyUser, Administrators and in the rest of the programs are: "All application packages", "All application packages Restricted" , System, Administrators, Users.
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
{
key.SetValue("My Program", "F:\Temp\Program.exe");
}
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
{
key.DeleteValue("My Program", false);
}
Continue reading...