This tutorial will show you how to change how long HDDs are inactive before automatically turned off in Windows 10 and Windows 11.
The Turn off hard disk after setting in Power Options lets you specify the period of inactivity before the disk is automatically powered down.
Having your HDDs automatically turn off after being idle can help save energy and extend the battery life.
When you or anything tries to access a HDD that has been turned off, there will be a delay of a few seconds as the HDD automatically turns back on and spins up before being able to access it.
Reference:

Disk idle timeout
The Turn off hard disk after setting only applies to HDDs.
This does not apply to SSD, M.2, or NVMe drives.
- Option One: Change Turn Off Hard Disk After Idle Time in Power Options
- Option Two: Change Turn Off Hard Disk After Idle Time using Command
1 Open the Control Panel (icons view), and click/tap on the Power Options icon.
2 Click/tap on the Change plan settings link to the right of the power plan (ex: "Balanced") you want to change settings for. (see screenshot below)
This will usually be for your active power plan.
3 Click/tap on the Change advanced power settings link. (see screenshot below)
4 In Power Options, expand open Hard disk and Turn off hard disk after. (see screenshot below step 5)
5 Select Never or type how many minutes timeout you want in the On battery and/or Plugged in drop menus, and click/tap on OK. (see screenshot below)
You will only see separate On battery and Plugged in settings if your device has a battery or connected to a UPS.
The default On battery time is 10 minutes.
The default Plugged in time is 20 minutes.
6 You can now close the Control Panel if you like.
This option will apply to your current active power plan.
1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.
2 Type the command(s) below you want to use into Windows Terminal, and press Enter.
Substitute <minutes> in the commands below with how many minutes you want to turn off hard disk after.
Substitute <seconds> in the commands below with how many seconds you want to turn off hard disk after.
0 minutes or seconds would be to never turn off hard disks.
The default On battery time is 10 minutes or 600 seconds.
The default Plugged in time is 20 minutes or 1200 seconds.
powercfg -change -disk-timeout-dc <minutes>
powercfg /SETDCVALUEINDEX SCHEME_CURRENT 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e <seconds>
You would use this option for a desktop computer, since desktop computers will not have separate On battery and Plugged in options available unless it has a data connection to a UPS.
powercfg -change -disk-timeout-ac <minutes>
powercfg /SETACVALUEINDEX SCHEME_CURRENT 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e <seconds>
That's it,
Shawn Brink