-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
start-taking-screenshots.bat
executable file
·47 lines (33 loc) · 1.53 KB
/
start-taking-screenshots.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
36
37
38
39
40
41
42
43
44
45
46
47
@ECHO off
IF NOT EXIST %cd%\screenshots MKDIR %cd%\screenshots
FOR /F "tokens=*" %%i IN (%cd%\config.ini) DO SET %%i
FOR /f %%a IN ('WMIC OS GET LocalDateTime ^| FIND "."') DO SET DTS=%%a
SET SessionId=%DTS:~0,4%-%DTS:~4,2%-%DTS:~6,2%_%DTS:~8,2%-%DTS:~10,2%-%DTS:~12,2%
IF NOT EXIST %cd%\screenshots\%SessionId% MKDIR %cd%\screenshots\%SessionId%
ECHO Started Taking Screenshots...
ECHO/
ECHO A screenshot will be taken every %ScreenshotInterval% seconds and saved to the following folder:
ECHO %cd%\screenshots\%SessionId%
IF %UseRBTray%==true (
IF NOT EXIST %cd%\tools\RBTray.exe (
ECHO Info: RBTray is missing. If you want to be able to minimize this window to the system tray, please
ECHO download RBTray from http://rbtray.sourceforge.net and place 'RBTray.exe' and 'RBHook.dll' in the folder %cd%\tools
) ELSE (
TASKLIST /NH /FI "IMAGENAME eq RBTray.exe" | FIND /I "RBTray.exe" >NUL || START %cd%\tools\RBTray.exe
ECHO/
ECHO To hide this window in the system tray press the minimize button with the RIGHT Mouse Button.
)
)
SET /A Counter=0
:loop
TIMEOUT /nobreak /t %ScreenshotInterval%
FOR /f %%a IN ('WMIC OS GET LocalDateTime ^| FIND "."') DO SET DTS=%%a
SET DateTime=%DTS:~0,4%-%DTS:~4,2%-%DTS:~6,2%_%DTS:~8,2%-%DTS:~10,2%-%DTS:~12,2%
SET /A Counter+=1
IF %UsePictureCounter%==true (
SET ScreenshotPath=%cd%\screenshots\%SessionId%\%Counter%.jpg
) ELSE (
SET ScreenshotPath=%cd%\screenshots\%SessionId%\%DateTime%.jpg
)
CALL %cd%\tools\screenCapture.bat %ScreenshotPath%
GOTO loop