-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.bat
35 lines (35 loc) · 1.05 KB
/
Test.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@echo off
:: Check for PsShutdown
WHERE psshutdown >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo PsShutdown wasn't found.
echo Get it from Microsoft at https://docs.microsoft.com/en-us/sysinternals/downloads/psshutdown
pause
exit
) else (
echo PsShutdown installed correctly
)
pause
:: Ensure proper wakeup is detected
Echo "Put your PC to sleep and wake it up as you usually do."
pause
cd %~dp0
powercfg -lastwake > %~dp0lastwake.temp
for /f "delims=" %%x in (%~dp0lastwake.temp) do set lastwake=%%x
:: Remove all spaces
set lastwake=%lastwake: =%
del %~dp0lastwake.temp
if "%lastwake%" == "PowerButton" (
echo User wakeup detected. NeverWake should work without issue.
) ELSE (
if "%lastwake:~0,15%" == "WakeSourceCount" (
:: Hibernate wakeup fires a troubleshooter event
:: But clears the wakeup reasons instead of logging a new one
echo User wakeup detected. NeverWake should work without issue.
goto END
)
echo Improper wakeup detected. Wakeup type "%lastwake%".
echo If this type should be treated as correct, report it as an issue on Github.
)
:END
pause