Optimize drives (defragsvc) Service Defaults in Windows 11

Helps the computer run more efficiently by optimizing files on storage drives.

Default Settings

Startup type: Manual
Display name:Optimize drives
Service name:defragsvc
Service type:own
Error control:normal
Object:localSystem
Path:%SystemRoot%\system32\svchost.exe -k defragsvc
File:%SystemRoot%\System32\defragsvc.dll
Registry key:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\defragsvc
Privileges:
  • SeChangeNotifyPrivilege
  • SeImpersonatePrivilege
  • SeIncreaseWorkingSetPrivilege
  • SeTcbPrivilege
  • SeSystemProfilePrivilege
  • SeAuditPrivilege
  • SeCreateGlobalPrivilege
  • SeBackupPrivilege
  • SeManageVolumePrivilege

Default Behavior

Optimize drives is a Win32 service. In Windows 11 it starts only if the user, an application or another service starts it. When the Optimize drives service is started, it logs on as localSystem and running in its own process of svchost.exe. If Optimize drives fails to start, the failure details will be recorded into Event Log. Then Windows 11 should boot up and notify the user about the defragsvc service startup failure.

Dependencies

Optimize drives cannot be started, if the Remote Procedure Call (RPC) service won't start.

Restore Default Startup Configuration of Optimize drives

Before you begin doing this, make sure that all the services on which Optimize drives depends are configured by default and function properly. See the list of dependencies above.

1. Run the Command Prompt as an administrator.

2. Copy the command below, paste it into the command window and press ENTER:

sc config defragsvc start= demand

3. Close the command window and restart the computer.

The defragsvc service is using the defragsvc.dll file that is located in the C:\Windows\System32 directory. If the file is removed or corrupted, read this article to restore its original version from Windows 11 installation media.