Saturday, 12 June 2021

Battery Alert Using Batch Program

:repeat
Goto get-battery
Echo "%Ba%"
:Next
TIMEOUT /T 600  
if "%Ba%"  GEQ "80" Goto Alert
goto repeat
 
:Alert
echo Your battery has finished charging
mshta javascript:alert("Unplug charger");close();
TIMEOUT /T 500
goto repeat
 
:get-battery
for /f "tokens=2 delims==" %%E in ('wmic path Win32_Battery get EstimatedChargeRemaining /value') do (set "Ba=%%E")
Goto Next


Save the above code in a .bat file. Place this file in startup (shell:startup)

Tuesday, 1 June 2021

Set timer using Google.com

Search for 

timer 2s
Here s, stands for seconds

timer 2 or timer 2h
if nothing is specified then hour or h denotes hour

timer 2m
m for minutes

Wednesday, 23 September 2020

No screensaver script

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Do While True
WshShell.SendKeys("{SCROLLLOCK}")
WScript.Sleep(174000)
Loop


Save above content with vbs extension in Notepad.

Paste this file in startup folder, so that it automatically runs whenever you start your system.

Goto run (Windows Key + R ), type shell:startup




This script, press Scroll Lock every 2.9 minutes (17400 milliseconds), so that screensaver doesn't appear.