Windows: Enable or disable Features from command line

Hi,

some usefull tools like telnet.exe are disabled by default in Windows Vista and later version. You can enable this and other features by command line using dism.
dism called with the get-features parameter lists all available features and its current state.
Note: Featurenames are case sensitive.
C:\>dism /online /Get-Features

.....
Feature Name : TelnetServer
State : Disabled

Feature Name : TelnetClient
State : Enabled
......

and the Enable-Feature option install them

C:\>dism /online /Enable-Feature:TelnetClient

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Image Version: 6.1.7600.16385

Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

To disable features use Disable-Feature

C:\>dism /online /Disable-Feature:TelnetClient

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Image Version: 6.1.7600.16385

Disabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

If you want to get more infos about a features

C:\>dism /online /Get-FeatureInfo:TelnetClient

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Image Version: 6.1.7600.16385

Feature Information:

Feature Name : TelnetClient
Display Name : Telnet Client
Description : Connect to remote computers by using the Telnet protocol
Restart Required : Possible
State : Disabled

Custom Properties:

(No custom properties found)

The operation completed successfully.

Michael

2 thoughts on “Windows: Enable or disable Features from command line”

    1. Hi Yoannatan,

      depending on your Windows Version. For Windows 7 ist not easy. Since Windows 8 you can use Powershell instead of dism:

      if((Get-WindowsOptionalFeature -Online -FeatureName "TelnetCLient").State -eq "disabled"){Enable-WindowsOptionalFeature -Online -FeatureName "TelnetCLient"}
      

      Michael

Leave a Reply