Powershell – Using powershell to disable services, fails with ‘specified service does not exist’

powershellservicewindows-8.1

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!

Best Answer

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