Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to run the following powershell command to disable Superfetch on a Windows 8.1 machine. Powershell window is open as Administrator and I am logged in as administrator.

Set-Service -name Superfetch -StartupType Disabled -Status Stopped

However I receive the following error

Service 'Superfetch (SysMain)' cannot be configured due to the following error: The specified service does not exist as an installed service
+ CategoryInfo          : PermissionDenied: (System.ServiceProcess.ServiceController:ServiceController) [Set-Service], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotSetService,Microsoft.PowerShell.Commands.SetServiceCommand
+ PSComputerName        : xxx.xxx.xxx.xxx

Clearly this service is installed, I see it in the installed services snap-in. I see the CategoryInfo as 'PermissionDenied'. How can I disable this service via powershell? I am logged in as an admin! Thanks!

share|improve this question
1  
Are you sure that's the correct service name? Open up a command prompt and type sc query. You might have to dump it to a text file. This will give you the correct service name you're looking for. It's entirely possible that the service name is called something other than the display name. –  Techie Joe Jan 21 at 18:51
    
yes. If I run 'Get-Service' with that name it returns the service object. not to mention the fact that it keys with its authoritative name (SysMain) leads me to believe the service is correct. –  Richthofen Jan 21 at 19:02
    
See @Bartłomiej Zarzecki's answer below. –  Techie Joe Jan 21 at 19:04

1 Answer 1

up vote 2 down vote accepted

because the service name is "SysMain" not "Superfetch".

PS C:\Windows\system32> Set-Service -name SysMain -StartupType Disabled -Status Stopped

However You will probably get now this:

Set-Service : Cannot stop service 'Superfetch (SysMain)' because it is dependent on other services.

because of these dependencies: superfetch service dependencies

share|improve this answer
    
ok, you guys were right. friendly name is not enough for -set-service, you gotta use canonical name, which is available by running 'Get-Service' –  Richthofen Jan 21 at 19:07
1  
@Richthofen however You can use "Get-Service superfetch | Set-Service -StartupType Disabled -Status Stopped" –  Bartłomiej Zarzecki Jan 21 at 19:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.