30

On my Sony Viao pcg-811124 laptop with Windows 7, I disabled all non-Windows services through msconfig. When I restarted my laptop, it booted up, but I cannot view the screen, even in safe mode. I may have disabled a driver, but now I have no way of knowing which one.

So, not only do I not know which services I disable and need to enable, I can't seem to even enable the services I know that I have (for example, JungleDisk). When tried to restart it via the command line, I got prompted that I could not restart this service because it had been disabled.

How do I get my services enabled again?

2 Answers 2

44

I believe the command you are looking for is:

sc config servicenamehere start= auto

You'll need to know the name of the service though - to view this from the command line, try this command - this will show all services:

sc query type= service state= all

If you want to see only stopped services, run this command:

sc query type= service state= inactive

The list of services output by the query can be quite long. You may filter it by using findstr (see post here) . For example

sc query type= service state= all | findstr "ssh"

Will select the output lines of the services list that contain the string "ssh"

Note: For some services you may need also administrator privileges, you will notice it on getting the message Access is denied after executing the sc command. In that case open the Command Prompt (Admin) by pressing 'Windows + X' keys.

2
  • 7
    NOTE: the space after the = is an essential part of the syntax.
    – Nathan
    Commented Jun 12, 2014 at 1:03
  • 2
    No it's not, at least not in Windows 10. Commented Mar 16, 2017 at 17:31
4

You can use PowerShell! (To start it, type powershell at a normal command prompt.)

The Get-Service cmdlet gets a list of services, which you can filter by any property. For example, this gets a list of disabled services:

Get-Service | ? {$_.StartType -eq 'Disabled'}

The Set-Service cmdlet can set several properties of a given service, including the startup type. For example, this sets the lanmanserver service to start automatically:

Set-Service 'lanmanserver' -StartupType Automatic

To make all currently disabled services start automatically, use this command:

Get-Service | ? {$_.StartType -eq 'Disabled'} | Set-Service -StartupType Automatic
2
  • Is there any way to check the StartupType of the service before changing it? Get-Service doesn't seem to have that info.
    – Shayan
    Commented Aug 12, 2022 at 17:10
  • 1
    @Shayan The objects returned by Get-Service do have a StartType property (as I used in my first command), but for some reason it's not shown by default. On PowerShell 5 (and newer, I assume), you can pipe through select * to see more properties including StartType.
    – Ben N
    Commented Aug 12, 2022 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .