using Microsoft.Win32; RegistryKey key = Registry.LocalMachine; RegistryKey soft = key.OpenSubKey(@"SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon", true); soft.SetValue("Shell", "explorer.exe"); //可以改为其它的启动程序,但是路径必须完整,如:(D:Dataabc.exe) soft.Close(); key.Close();