2

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!

Richthofen
  • 275
  • 1
  • 4
  • 8
  • 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 '14 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 '14 at 19:02
  • See @Bartłomiej Zarzecki's answer below. – Techie Joe Jan 21 '14 at 19:04
  • One extra thing for me. When I wanted to disable a SQL Server (named instance), its canonical name was `MSSQL$INSTANCE`, I needed to remember to escape the $ because of powershell. The $ character is escaped by prepending a backtick: `$ – Michael J Swart Jun 20 '17 at 20:39

1 Answers1

3

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

Bartłomiej Zarzecki
  • 1,726
  • 1
  • 13
  • 17