← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680879]: Command Line Options / Logfile

 

Question #680879 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/680879

    Status: Needs information => Solved

Mike Praeuner confirmed that the question is solved:
still experimenting but this is my current solution (solved)

--batch file--
@echo off
set starttime=%TIME%
set startcsec=%STARTTIME:~9,2%
set startsecs=%STARTTIME:~6,2%
set startmins=%STARTTIME:~3,2%
set starthour=%STARTTIME:~0,2%
set /a starttime=(%starthour%*60*60*100)+(%startmins%*60*100)+(%startsecs%*100)+(%startcsec%)
:TimeThis
rem setup environment
@echo on
taskkill /f /im nox*
taskkill /f /im java*
PATH=%PATH%;D:\MikE\Sikuli Scripts\
nircmd.exe monitor on
nircmd.exe setcursor 100 50
nircmd.exe movecursor 10 10
@echo off
rem a way to stop from progressing
timeout 30
@echo on
>>"d:\mike\Sikuli Scripts\Collect.log" (
echo --------------------------------------------------------------------------------------------
echo  %date%-%time%
echo --------------------------------------------------------------------------------------------
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect1"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect2"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect3"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect4"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect5"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect6"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect7"
timeout 1
java -jar "d:\MikE\sikulix.jar" -r "d:\mike\Sikuli Scripts\Collect8"
)
@echo off
set endtime=%time%
set endcsec=%endTIME:~9,2%
set endsecs=%endTIME:~6,2%
set endmins=%endTIME:~3,2%
set endhour=%endTIME:~0,2%
if %endhour% LSS %starthour% set /a endhour+=24
set /a endtime=(%endhour%*60*60*100)+(%endmins%*60*100)+(%endsecs%*100)+(%endcsec%)
set /a timetaken= ( %endtime% - %starttime% )
set /a timetakens= %timetaken% / 100
set timetaken=%timetakens%.%timetaken:~-2%

rem end script
rem teardown environment
taskkill /f /im nox*
taskkill /f /im java*
rem last updated 5/12/19
>>"d:\mike\Sikuli Scripts\Collect.log" (
echo --------------------------------------------------------------------------------------------
echo  %date%-%time%
echo --------------------------------------------------------------------------------------------
echo.
echo Took: %timetaken% sec.
)
timeout 300
rem pause

References:
https://www.windows-commandline.com/get-date-time-batch-file/
https://stackoverflow.com/questions/20484151/redirecting-output-from-within-batch-file

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.