Skip to content

Instantly share code, notes, and snippets.

@hagbarddenstore
Last active August 29, 2015 14:01
Show Gist options
  • Save hagbarddenstore/fd1d7ea28e7271ec7d09 to your computer and use it in GitHub Desktop.
Save hagbarddenstore/fd1d7ea28e7271ec7d09 to your computer and use it in GitHub Desktop.
var allServices = new Dictionary<string, string[]>
{
{ "6.3", new[] { "Appmgmt", "bthserv", "PeerDistSvc", "NfsClnt", "TrkWks", "WPCSvc",
"vmickvpexchange", "vmicguestinterface", "vmicshutdown", "vmicheartbeat",
"vmicrdv", "vmictimesync", "vmicvss", "IEEtwCollectorService", "iphlpsvc",
"Netlogon", "Netlogon", "CscService", "RpcLocator", "MSiSCSI", "SensrSvc",
"ScDeviceEnum", "SCPolicySvc", "SNMPTRAP", "StorSvc", "WbioSrvc",
"wcncsvc", "fsvc", "WMPNetworkSvc" } },
{ "6.2", new[] { "WMPNetworkSvc", "wcncsvc", "WbioSrvc", "StorSvc", "SNMPTRAP",
"SCPolicySvc", "SensrSvc", "RpcLocator", "CscService", "Netlogon", "MSiSCSI",
"iphlpsvc", "vmicvss", "vmictimesync", "vmicrdv", "vmicheartbeat",
"vmicshutdown", "vmickvpexchange", "WPCSvc", "TrkWks", "NfsClnt",
"CertPropSvc", "PeerDistSvc", "bthserv", "Appmgmt" } },
{ "6.1", new[] {"WSearch", "WMPNetworkSvc", "wcncsvc", "StorSvc", "SNMPTRAP",
"SCPolicySvc", "SCardSvr", "RemoteRegistry", "RpcLocator", "WPCSvc",
"CscService", "napagent", "Netlogon", "MSiSCSI", "iphlpsvc", "TrkWks",
"CertPropSvc", "bthserv", "AppMgmt" } },
{ "6.0", new[] { "TrkWks", "WinHttpAutoProxySvc", "WSearch", "WinRM", "WebClient",
"UmRdpService", "TabletInputService", "SNMPTRAP", "SCPolicySvc", "SCardSvr",
"RemoteRegistry", "CscService", "Netlogon", "MSiSCSI", "iphlpsvc", "Fax",
"CertPropSvc" } },
{ "5.1", new[] { "WmiApSrv", "W32Time", "WebClient", "UPS", "Netlogon", "SCardSvr",
"TlntSvr", "seclogon", "RemoteRegistry", "RDSessMgr", "RSVP", "WmdmPmSN",
"xmlprov", "mnmsrvc", "cisvc", "ERSvc" } }
};
string[] services;
if (checkBox5.Checked && allServices.TryGetValue(Environment.OSVersion.Version.ToString(), out services))
{
services.ToList().ForEach(x => ServiceHelper.ChangeStartMode(new ServiceController(service), ServiceStartMode.Manual));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment