-
Prüfen ob eine Anwendung im Autostart eingetragen ist
public static bool RunOnStartupCurrentUser( string applicationName )
{
RegistryKey regkey = Registry.CurrentUser.OpenSubKey
( “SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run”, true );
if ( regkey.GetValue(applicationName) == null )
{
return false;
}
else
{
return true;
}
}
-
Anwendung in der registry eintragen
public static void AddCurrentUser(string executablePath, string applicationName)
{
RegistryKey regkey = Registry.CurrentUser.OpenSubKey
( “SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run”, true );
regkey.SetValue( applicationName, executablePath );
}
-
Anwendung aus der Registry löschen
public static void RemoveCurrentUser(string applicationName)
{
RegistryKey regkey = Registry.CurrentUser.OpenSubKey
( “SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run”, true );
regkey.DeleteValue(applicationName,true);
}
Mit msconfig.exe last sich dann auch noch recht einfach prüfen ob
die Werte wirklich eingetragen wurden.
Mehr gibt es nicht zu tun.





