操作注册表案例,开机启动CMD

static void Main(string[] args)
        {
            //打开注册表子项
            RegistryKey key = Registry.LocalMachine
                .OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            //增加开机启动项
            key.SetValue("Cmd", "C:\\Windows\\System32\\cmd.exe");
        }

 

posted @ 2016-08-20 23:29  kennyhip  阅读(582)  评论(0)    收藏  举报