Battery Report and SleepStudy Report
On the Surface subreddit (http://www.reddit.com/r/Surface) I found people mention the "Battery Report" and "SleepStudy Report" pieces of the Windows command line tool "powercfg". Here are a couple of small batch (.bat) files you can make to run the reports and open the result in your web browser, then delete the report file when done to keep things tidy. These reports can help you monitor your computer's battery usage and sleep activity. Battery Report does not need admin privileges so that script is very simple, but the SleepStudy one does, so there is extra code to create the UAC window for admin privileges. (UAC code found here: http://stackoverflow.com/questions/1894967/how-to-request-administrator-access-inside-a-batch-file originally https://sites.google.com/site/eneerge/scripts/batchgotadmin)
cd %HOMEPATH% powercfg /BATTERYREPORT battery-report.html del battery-report.html
Run SleepStudy Report.bat
@echo off :: BatchGotAdmin :------------------------------------- REM --> Check for permissions >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" REM --> If error flag set, we do not have admin. if '%errorlevel%' NEQ '0' ( echo Requesting administrative privileges... goto UACPrompt ) else ( goto gotAdmin ) :UACPrompt echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" set params = %*:"="" echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" exit /B :gotAdmin pushd "%CD%" CD /D "%~dp0" :-------------------------------------- cd %HOMEPATH% powercfg sleepstudy sleepstudy-report.html del sleepstudy-report.html