Skip to content

Commit

Permalink
Finally fixed the error im so happy
Browse files Browse the repository at this point in the history
  • Loading branch information
byronbytes committed Mar 7, 2022
1 parent 44e07df commit 23a2c1a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
24 changes: 14 additions & 10 deletions Tasks/Forms/frmStartupPrograms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ private void SetStartup(string AppName, bool enable)
// Remove Startup Program (Registry)
startupKey.Close();
startupKey = Registry.LocalMachine.OpenSubKey(runKey, true);
startupKey.GetSubKeyNames();
startupKey.DeleteSubKey(AppName, true);
startupKey.DeleteValue(AppName, true);
startupKey.Close();

}
Expand Down Expand Up @@ -105,14 +104,19 @@ private void button1_Click(object sender, EventArgs e)
}


if (StartupProcesses.SelectedItems[0].SubItems[2].Text == "Startup")
{
File.Delete(fileStartup);
RefreshList();
MessageBox.Show(fileStartup);
}


// if (StartupProcesses.SelectedItems[0].SubItems[2].Text == "Startup")
// {
// try
// {
// File.Delete(fileStartup);
// RefreshList();
// }
// catch
// {
// MessageBox.Show("An error has occurred.");
// }

// }
}

class StartUpProgram {
Expand Down
4 changes: 2 additions & 2 deletions Tasks/Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Tasks 256x256 Logo.ico</ApplicationIcon>
<Version>3.4.0</Version>
Expand All @@ -19,7 +19,7 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AssemblyVersion>3.4.0.0</AssemblyVersion>
<UseWPF>False</UseWPF>
<SupportedOSPlatformVersion>8.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<StartupObject>Tasks.Program</StartupObject>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Tasks/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
Expand Down

0 comments on commit 23a2c1a

Please sign in to comment.