Sleep / shutdown Problems


Polonut

Well-known member
Member
Local time
6:56 PM
Posts
26
OS
Windows 11 Pro
Hi Everyone
Just recently, I noticed that my PC is not going to sleep at the programmed time. Several Days later, (a further change) I found that instead of going to sleep, the PC now started shutting down completely instead of sleep.
I have tried all the usual checks - but no success. I have not made any recent chage to hardware or software. Is there something obvious I have not tried?
Your thoughts would be appreciated
Colin

25H2 (OSBuild 26200.9711)
 

My Computer My Computer

At a glance

Windows 11 ProIntel i5-33468Gbinternal
OS
Windows 11 Pro
Computer type
PC/Desktop
Manufacturer/Model
Self built
CPU
Intel i5-3346
Motherboard
gigabyte H61-s2pv rev2.2
Memory
8Gb
Graphics Card(s)
internal
Sound Card
internal
Monitor(s) Displays
philips 226e9q
Screen Resolution
1920 x 1080
Hard Drives
Samsung evo 860 - WD 500Gb - seagate 2 TB
PSU
500watt
Case
ANTEC
Cooling
standard
Keyboard
standard querty ps2
Mouse
GX Trust REDEX 11
Internet Speed
150 full fibre
Browser
Google
Antivirus
Webroot secureanywhere
Please run > post share links




1) Administrative PS > post share links: get_powercfg_info.bat:


Code:
<# : batch script
@echo off
PowerShell.exe -NoProfile Invoke-Expression ([System.IO.File]::ReadAllText('%0'))
goto :eof
#>

[CmdletBinding(SupportsShouldProcess=$false)]
Param()

Set-StrictMode -Version 'latest'

function Test-RunningAsAdmin
{
    [System.Security.Principal.WindowsIdentity]$currentIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
    [System.Security.Principal.WindowsPrincipal]$currentPrincipal = [System.Security.Principal.WindowsPrincipal]::new($currentIdentity)

    Write-Output ($currentPrincipal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator))
}

$InformationPreference = [Management.Automation.ActionPreference]::Continue

if (-not (Test-RunningAsAdmin))
{
    Write-Warning 'This script requires administrator privileges! Please restart it by running it as an administrator.'
}
else
{
    [string]$temporaryFolderPath = [string]::Empty

    do
    {
        $temporaryFolderPath = [IO.Path]::GetTempFileName()
        if (Test-Path $temporaryFolderPath) { Remove-Item -Path $temporaryFolderPath -Recurse -Force }
    } while ((-not ([string]::IsNullOrEmpty($temporaryFolderPath))) -and (Test-Path -Path $temporaryFolderPath))

    # Create the temporary folder if it does not exist.
    if (-not (Test-Path -Path $temporaryFolderPath)) { New-Item -Path $temporaryFolderPath -ItemType 'Directory' | Out-Null }

    # Clear any existing contents of the temporary folder.
    Get-ChildItem -Path $temporaryFolderPath -Force | Remove-Item -Recurse -Force

    [string]$logFilePath = Join-Path -Path $temporaryFolderPath -ChildPath 'powercfg-info.txt'
    if (Test-Path -Path $logFilePath) { Remove-Item -Path $logFilePath -ErrorAction SilentlyContinue }

    [string]$powercfgPath = Join-Path ([System.Environment]::SystemDirectory) 'powercfg.exe'

    [System.Diagnostics.ProcessStartInfo]$startInfo = [System.Diagnostics.ProcessStartInfo]::new()
    $startInfo.FileName = $powercfgPath
    $startInfo.UseShellExecute = $false
    $startInfo.RedirectStandardOutput = $true
    $startInfo.RedirectStandardError = $true

    if (Test-Path -Path $powercfgPath)
    {
        [string]$energyReportPath = Join-Path -Path $temporaryFolderPath -ChildPath 'energy-report.html'
        [string]$batteryReportPath = Join-Path -Path $temporaryFolderPath -ChildPath 'battery-report.html'
        [string]$sleepStudyReportPath = Join-Path -Path $temporaryFolderPath -ChildPath 'sleepstudy-report.html'
        ## [string]$sleepDiagnosticsReportPath = Join-Path -Path $temporaryFolderPath -ChildPath 'sleep-diagnostics-report.html'
        ## [string]$systemPowerReportPath = Join-Path -Path $temporaryFolderPath -ChildPath 'system-power-report.html'

        @('/list',
          '/availablesleepstates',
          '/lastwake',
          '/devicequery wake_armed',
          '/waketimers',
          '/requests',
          "/energy /output `"$($energyReportPath)`" /duration 10",
          "/batteryreport /output `"$($batteryReportPath)`"",
          "/sleepstudy /output `"$($sleepStudyReportPath)`""
          ## "/systemsleepdiagnostics /output `"$($sleepDiagnosticsReportPath)`"", # Command is deprecated.
          ## "/systempowerreport /output `"$($systemPowerReportPath)`"" # Generates the same report as /sleepstudy.
         ) |
        ForEach-Object {
            Write-Output "Running PowerCfg $($_)" | Tee-Object -FilePath $logFilePath -Append

            $startInfo.Arguments = @($_)

            [System.Diagnostics.Process]$dsRegCmdProcess = [System.Diagnostics.Process]::new()
            $dsRegCmdProcess.StartInfo = $startInfo
            $dsRegCmdProcess.Start() | Out-Null

            Write-Output $dsRegCmdProcess.StandardOutput.ReadToEnd() | Out-String | Tee-Object -FilePath $logFilePath -Append
        }
    }
    else
    {
        Write-Warning "$($powercfgPath) does not exist!"
    }

    [string]$zipFilePath = "powercfg_info_$(Get-Date -Format 'yyyy-MM-dd_HH-mm-ss').zip"
    [System.IO.Path]::GetInvalidFileNameChars() | ForEach-Object { $zipFilePath = $zipFilePath -replace "\$($_)", [string]::Empty }
    $zipFilePath = Join-Path ([Environment]::GetFolderPath([Environment+SpecialFolder]::DesktopDirectory)) $zipFilePath

    1..2 | ForEach-Object { Write-Information ([string]::Empty) } # Write some empty lines, just for spacing.
    Write-Information "Compressing gathered files into a .zip archive..."
    Get-ChildItem -Path $temporaryFolderPath |
    ForEach-Object {
        Compress-Archive -Path ($_.FullName) -Update -DestinationPath $zipFilePath
        Start-Sleep -Seconds 1
        Remove-Item -Path $_.FullName -Recurse -Force
    }

    1..5 | ForEach-Object { Write-Information ([string]::Empty) } # Write some empty lines, just for spacing.
    Write-Information "The PowerCfg report files have been gathered into a .zip file on your desktop,"
    Write-Information "$($zipFilePath)."
    Write-Information "Please upload the file as an attachment to your post on the forum."

    Remove-Item -Path $temporaryFolderPath -Recurse -Force
}

pause



(For Windows 10 and some versions Windows 11)







2) V2 log collector:





3) Administrative PS: > post share links

wevtutil epl Application "%userprofile%\Desktop\application.evtx"

wevtutil epl System "%userprofile%\Desktop\system.evtx"
 

My Computer My Computer

At a glance

Windows 10Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz16 GB Total: Manufacturer : Samsung MemoryTyp...NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
OS
Windows 10
Computer type
Laptop
Manufacturer/Model
HP
CPU
Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
Motherboard
Product : 190A Version : KBC Version 94.56
Memory
16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
Graphics Card(s)
NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
Sound Card
IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
Hard Drives
Model Hitachi HTS727575A9E364
Antivirus
Microsoft Defender
Other Info
Mobile Workstation
the PC now started shutting down completely instead of sleep
I suggest you reinstall the display driver in case it has become corrupt in use [there is no diagnostic test for this].


Denis
 

My Computer My Computer

At a glance

Windows 11 Home x64 Version 26H2 Build 26300....
OS
Windows 11 Home x64 Version 26H2 Build 26300.9457

Latest Support Threads

Latest Tutorials

Back
Top Bottom