失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > windows@启用休眠@关闭休眠@删除休眠文件@查看休眠文件@命令行休眠powercfg

windows@启用休眠@关闭休眠@删除休眠文件@查看休眠文件@命令行休眠powercfg

时间:2023-08-09 07:12:05

相关推荐

windows@启用休眠@关闭休眠@删除休眠文件@查看休眠文件@命令行休眠powercfg

文章目录

ref设置前提:驱动要求 GUI@控制面板方式启用powercfg.cpl允许更改不可用按钮:the result CLI@powercfg.exe命令行操作基本语法和帮助关于休眠的子命令启用休眠😊hiberfil.sys系统休眠文件使计算机休眠😊shutdown相关用法 关闭休眠功能😊@删除休眠文件其他相关子命令调整休眠文件大小

ref

Shut down, sleep, or hibernate your PC - Microsoft Supportwin10删除休眠文件的方法是什么_windows10休眠文件怎么删除-系统城 ()

设置前提:

驱动要求

您的计算机已经安装了必要的驱动 最好确保显卡在内的所有驱动都是正常的否则可能找不到或者无法顺利启用休眠功能

GUI@控制面板方式启用

powercfg.cpl

您可以用命令行或者win+R输入powercfg.cpl来快速跳转到相应的设置页面

PS C:\Users\cxxu> powercfg.cpl

允许更改不可用按钮:

the result

CLI@powercfg.exe命令行操作

PS C:\Users\cxxu> powercfg.exe -?

基本语法和帮助

POWERCFG /COMMAND [ARGUMENTS]Description:Enables users to control power settings on a local system.For detailed command and option information, run "POWERCFG /? <COMMAND>"

关于休眠的子命令

POWERCFG /HIBERNATE <ON|OFF>POWERCFG /HIBERNATE /SIZE <PERCENT_SIZE>POWERCFG /HIBERNATE /TYPE <REDUCED|FULL>Alias:POWERCFG /HDescription:Enables/disables the hibernate feature or sets the hiberfile size.Parameter List:<ON|OFF>Enables/disables the hibernate feature./SIZE <PERCENT_SIZE> Specifies the desired hiberfile size as a percentageof the total memory size. The default size cannot besmaller than 40. This parameter will also causehibernate to be enabled./TYPE <REDUCED|FULL> Specifies the desired hiberfile type. A reducedhiberfile only supports hiberboot.Examples:POWERCFG /HIBERNATE OFFPOWERCFG /HIBERNATE /SIZE 100POWERCFG /HIBERNATE /TYPE REDUCED

启用休眠😊

使用命令行powercfg -h on系统将尝试启用休眠功能 如果您的软硬件都支持,一般情况下是可以正常启用个别情况(比如驱动问题,可能会执行失败,那么您可能需要修复一下驱动问题)

hiberfil.sys系统休眠文件

当您执行休眠操作后,系统将在C:\目录生成一个隐藏系统文件hiberfil.sys

使计算机休眠😊

比如使用命令行shutdown -h

shutdown相关用法

shutdown.exe -?

shutdown | Microsoft Learn

🚀 shutdown.exe -?Usage: C:\WINDOWS\system32\shutdown.exe [/i | /l | /s | /sg | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/soft] [/fw] [/f][/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]No args Display help. This is the same as typing /?./? Display help. This is the same as not typing any options./i Display the graphical user interface (GUI).This must be the first option./l Log off. This cannot be used with /m or /d options./s Shutdown the computer./sg Shutdown the computer. On the next boot, if Automatic Restart Sign-Onis enabled, automatically sign in and lock last interactive user.After sign in, restart any registered applications./r Full shutdown and restart the computer./g Full shutdown and restart the computer. After the system is rebooted,if Automatic Restart Sign-On is enabled, automatically sign in andlock last interactive user.After sign in, restart any registered applications./a Abort a system shutdown.This can only be used during the time-out bine with /fw to clear any pending boots to firmware./p Turn off the local computer with no time-out or warning.Can be used with /d and /f options./h Hibernate the local computer.Can be used with the /f option./hybrid Performs a shutdown of the computer and prepares it for fast startup.Must be used with /s option.节约篇幅........

关闭休眠功能😊@删除休眠文件

powercfg -h off

该命令删除应为启用休眠功能所产生的hiberfil.sys

该文件是系统文件,默认是隐藏文件

如果需要查看,可以用资源管理器勾选显示隐藏文件

或者使用powershell,输入以下命令查看

ls C:\ -Force|where{$_.FullName -like '*sys'}

PS C:\Users\cxxu> ls C:\ -Force|where{$_.FullName -like '*sys'}Directory: C:\Mode LastWriteTime Length Name---- ------------- ------ -----a-hs12/22/ 5:13 PM3371900928 hiberfil.sys-a-hs12/22/ 6:20 PM5475780608 pagefile.sys-a-hs12/21/ 11:08 AM 16777216 swapfile.sys

其他相关子命令

Command List:/LIST, /LLists all power schemes./QUERY, /Q Displays the contents of a power scheme./CHANGE, /X Modifies a setting value in the current power scheme./CHANGENAME Modifies the name and description of a power scheme./DUPLICATESCHEME Duplicates a power scheme./DELETE, /D Deletes a power scheme./DELETESETTINGDeletes a power setting./SETACTIVE, /SMakes a power scheme active on the system./GETACTIVESCHEME Retrieves the currently active power scheme./SETACVALUEINDEX Sets the value associated with a power settingwhile the system is powered by AC power./SETDCVALUEINDEX Sets the value associated with a power settingwhile the system is powered by DC power./IMPORT Imports all power settings from a file./EXPORT Exports a power scheme to a file./ALIASES Displays all aliases and their corresponding GUIDs./GETSECURITYDESCRIPTORGets a security descriptor associated with a specifiedpower setting, power scheme, or action./SETSECURITYDESCRIPTORSets a security descriptor associated with apower setting, power scheme, or action./HIBERNATE, /HEnables and disables the hibernate feature./AVAILABLESLEEPSTATES, /AReports the sleep states available on the system./DEVICEQUERY Returns a list of devices that meet specified criteria./DEVICEENABLEWAKE Enables a device to wake the system from a sleep state./DEVICEDISABLEWAKE Disables a device from waking the system from a sleepstate.....省略篇幅..

调整休眠文件大小

Hibernation file too big? Reduce size of hiberfil.sys in Windows 11/10 ()

例如:将休眠文件压缩到物理内存的50%(写入磁盘保存)

powercfg.exe /hibernate /size 50

如果压缩的百分比设置的过于低(比如低于40个百分点,可能导致休眠失败/蓝屏)

如果觉得《windows@启用休眠@关闭休眠@删除休眠文件@查看休眠文件@命令行休眠powercfg》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。