Mam problem z usługami ktoś powie co jest źle
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\AarSvc", true);
key.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key1 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\ALG", true);
key1.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key2 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\AppHostSvc", true);
key2.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key3 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\AppMgmt", true);
key3.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key4 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\autotimesvc", true);
key4.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key5 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\AxInstSV", true);
key5.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key6 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\BITS", true);
key6.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key7 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\CaptureService", true);
key7.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key8 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\cbdhsvc", true);
key8.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key9 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\CertPropSvc", true);
key9.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key10 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\ClipSVC", true);
key10.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key11 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\COMSysApp", true);
key11.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key12 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\CscService", true);
key12.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key13 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\dmwappushservice", true);
key13.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key14 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\DoSvc", true);
key14.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key15 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\DsSvc", true);
key15.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key16 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\DsmSvc", true);
key16.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key17 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\EFS", true);
key17.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key18 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\EntAppSvc", true);
key18.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key19 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\Fax", true);
key19.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key20 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\fhsvc", true);
key20.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key21 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\FontCache", true);
key21.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key22 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\FontCache3.0.0.0", true);
key22.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key23 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\icssvc", true);
key23.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key24 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\InstallService", true);
key24.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key25 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\HvHost", true);
key25.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key26 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\KtmRm", true);
key26.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key27 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\lfsvc", true);
key27.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key28 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\LicenseManager", true);
key28.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key29 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\lltdsvc", true);
key29.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key30 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\LxpSvc", true);
key30.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key31 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\MessagingService", true);
key31.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key32 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\MSDTC", true);
key32.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key33 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\MSiSCSI", true);
key33.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key34 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\MSMQ", true);
key34.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key35 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NcaSvc", true);
key35.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key36 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NcbService", true);
key36.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key37 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\Netlogon", true);
key37.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key38 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NetMsmqActivator", true);
key38.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key39 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NetPipeActivator", true);
key39.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key40 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NetTcpActivator", true);
key40.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key41 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NetTcpPortSharing", true);
key41.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key42 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\NgcSvc", true);
key42.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key43 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\OneSyncSvc", true);
key43.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key44 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\ose", true);
key44.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key45 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\osppsvc", true);
key45.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key46 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\PcaSvc", true);
key46.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key47 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\PhoneSvc", true);
key47.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key48 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\PimIndexMaintenanceSvc", true);
key48.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key49 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\pla", true);
key49.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key50 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\PushToInstall", true);
key50.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key51 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\RemoteRegistry", true);
key51.SetValue("Start", 4, RegistryValueKind.DWord);
RegistryKey key52 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\RetailDemo", true);
key52.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key53 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\RpcLocator", true);
key53.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key54 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SCardSvr", true);
key54.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key55 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\ScDeviceEnum", true);
key55.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key56 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SCPolicySvc", true);
key56.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key57 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SDRSVC", true);
key57.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key58 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\seclogon", true);
key58.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key59 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SEMgrSvc", true);
key59.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key60 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SENS", true);
key60.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key61 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SgrmBroker", true);
key61.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key62 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SharedAccess", true);
key62.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key63 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\smphost", true);
key63.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key64 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SmsRouter", true);
key64.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key65 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\SNMPTRAP", true);
key65.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key66 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\svsvc", true);
key66.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key67 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\StorSvc", true);
key67.SetValue("Start", 3, RegistryValueKind.DWord);
Process.Start("sc.exe", "Start StorSvc");
RegistryKey key68 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\swprv", true);
key68.SetValue("Start", 3, RegistryValueKind.DWord);
Process.Start("sc.exe", "Start swprv");
RegistryKey key69 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\stisvc", true);
key69.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key70 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\TabletInputService", true);
key70.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key71 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\TrkWks", true);
key71.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key72 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\TroubleshootingSvc", true);
key72.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key73 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\tzautoupdate", true);
key73.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key74 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\UevAgentService", true);
key74.SetValue("Start", 4, RegistryValueKind.DWord);
RegistryKey key75 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\UnistoreSvc", true);
key75.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key76 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\UserDataSvc", true);
key76.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key77 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\UsoSvc", true);
key77.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key78 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmicguestinterface", true);
key78.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key79 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmicheartbeat", true);
key79.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key80 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmickvpexchange", true);
key80.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key81 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmicrdv", true);
key81.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key82 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmicshutdown", true);
key82.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key83 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmictimesync", true);
key83.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key84 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmicvmsession", true);
key84.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key85 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\vmicvss", true);
key85.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key86 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\w3logsvc", true);
key86.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key87 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WaaSMedicSvc", true);
key87.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key88 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WalletService", true);
key88.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key89 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WAS", true);
key89.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key90 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WarpJITSvc", true);
key90.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key91 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\wbengine", true);
key91.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key92 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WerSvc", true);
key92.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key93 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WiaRpc", true);
key93.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key94 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WinRM", true);
key94.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key95 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\wisvc", true);
key95.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key96 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\wlidsvc", true);
key96.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key97 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\wmiApSrv", true);
key97.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key98 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WMPNetworkSvc", true);
key98.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key99 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WPDBusEnum", true);
key99.SetValue("Start", 3, RegistryValueKind.DWord);
Process.Start("sc.exe", "Start WPDBusEnum");
RegistryKey key100 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WpnService", true);
key100.SetValue("Start", 3, RegistryValueKind.DWord);
Process.Start("sc.exe", "Start WpnService");
RegistryKey key101 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WpnUserService", true);
key101.SetValue("Start", 4, RegistryValueKind.DWord);
RegistryKey key102 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\wscsvc", true);
key102.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key103 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\WSearch", true);
key103.SetValue("Start", 2, RegistryValueKind.DWord);
RegistryKey key104 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\wuauserv", true);
key104.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key105 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\XboxGipSvc", true);
key105.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key106 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\XblAuthManager", true);
key106.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key107 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\XblGameSave", true);
key107.SetValue("Start", 3, RegistryValueKind.DWord);
RegistryKey key108 = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Services\xboxgip", true);
key108.SetValue("Start", 3, RegistryValueKind.DWord);
MessageBox.Show("Usługi ustawione na tryb Bezpieczny");
Process.Start("shutdown.exe", "-r -t 10");
Gdy w ten sposób robię usługę np. Bufor Wydruku to wszystko działa poprawnie a tu wyskakuje :