Batch files…still around

i used to use a program from the M$ powertools called sleep.exe but recently i found a native solution. A ping to the loopback address takes a known amount of time and takes slightly less processing power than the old sleep.exe util. credit source

ping -n 120 1>nul

I use this in my redo.bat that i now have memorized

%1 %2 %3 %4 %5 %6 %7 %8 %9
ping -n 120 1>nul
goto start

this was originally conceived because ping fills the screen and is impossible to tell if it’s still scrolling or its paused. but i found it useful for many other things.

for sending email from scripts blat.exe has been replaced with mailsend-go Even tho it hates Gmail it works fine with M$.

Following is an example that sends me memory stats from an old snowflake server. I still need a little help with the tail command, but i didn’t use too many brain cycles on this.

set logfile=c:\share\hitask.log
echo “==============================================================” >> %logfile%
echo “==============================================================” >> %logfile%
date /t >> %logfile%
wmic OS get FreePhysicalMemory >> %logfile%
tasklist /FI “MEMUSAGE gt 100000” >> %logfile%

rem make sure the log file doesn’t grow too large, grrr doesn’t work right
: c:\share\tail -200 %logfile% > tmp%logfile%
: copy tmp%logfile% %logfile% -Y

c:\share\mailsend-go -sub “VHG Term Svr Memory Report” -smtp -port 587 auth -user -pass “ILikePie” -from “” -to “” -from “” body -msg “A log file is attached” attach -file “c:\share\hitask.log”

Example output:

sry too many NUL characters in DOS output