I need to enable/ disable the Windows Firewall on a Server 2008R2 core box but didn’t know what the Windows Firewall service name was for use with the sc
command. Then I learnt it it has a sub-command called GetKeyName
(and corresponding GetDisplayName
, for the reverse operation) to get the name from the display name.
1 2 3 |
C:\> sc getkeyname "Windows Firewall" [SC] GetServiceKeyName SUCCESS Name = MpsSvc |
Nice!
Also, as a reminder to myself the sc config
command is what you use to change the configuration of a service (make it disabled, manual, etc). When giving the options though be sure to include a space after the option. That is to say, the following works –
1 |
sc config MpsSvc start= Disabled |
But the following won’t –
1 |
sc config MpsSvc start=Disabled |