0

I am trying to make my Windows 8.1 system automatically take a screenshot every minute. This helps me with time tracking.

My current solution uses IrfanView. I wrote the following cmd batch file:

set IrfanView="C:\Program Files (x86)\IrfanView\i_view32.exe"
set DestDir=%~dp0.
set Cygwin=C:\cygwin64
REM see http://stackoverflow.com/questions/905226/mkdir-p-linux-windows
setlocal enableextensions

:loop

REM these for loops are really weird, but see SO
for /f "tokens=*" %%i in ('%Cygwin%\bin\date.exe +"%%y\%%m\%%d\%%H-%%M-%%S"') do set timestamp=%%i

set filename="%DestDir%\%timestamp%.png"
for %%F in (%filename%) do set dirname="%%~dpF"

if not exist %dirname% md %dirname%
%IrfanView% /ini="%~dp0" /capture=0 /convert=%filename%

%Cygwin%\bin\sleep.exe 60
goto :loop

and I put a copy of i_view32.ini in the target directory. Then I made a shortcut to the batch file and put it into the Windows 8.1 startup folder: shell:startup.

When I doubleclick the shortcut, the script starts and works fine. But it doesn't start automatically when I log in.

Why not?

The Event Log shows a BlueScreen event with image atikmpag.sys when I log in, but I do not know if that is related.

How do I work around this issue?

Canadian Luke
  • 24,199
  • 39
  • 117
  • 171
reinierpost
  • 2,220
  • 1
  • 18
  • 23
  • You say you put the batch file in the start-up directory: it is more usual to put a link there, with the script in a standard place. With the link you can control the command name and path (used in your script) and the initial directory, and you may find that it then behaves more uniformly. You can also turn echo on and log the output to a file (using `cmd /c "..."`), so that you can see what went on during start-up. – AFH May 27 '15 at 11:02
  • I put a *shortcut* to the batch file in the startup directory. In the actual script, echo is on, but I haven't tried logging the output, thanks! – reinierpost May 27 '15 at 12:00
  • Sorry, I was interrupted and misread your question. I usually check back that I have covered everything before posting, but didn't on this occasion. Mea culpa. – AFH May 27 '15 at 13:38
  • @reinierpost: Try a simple batch file that only echoes some text and then pauses. Does that run? Also, what's the need for Cygwin utilities here when Windows can do it all? – Karan May 28 '15 at 01:01
  • @Karan: I am just trying to get this to work. If you can tell me how to do it with Windows utilities I'll be happy. – reinierpost May 28 '15 at 08:29
  • @reinierpost: Did you try with a simple batch file as I suggested first? Cygwin dependency can be removed later if required. – Karan May 28 '15 at 18:17
  • @Karan: I just tried. Nothing shows up in the logfile at all. Not even when I place the batchfile itself in the startup folder. Other shortcuts are working fine. – reinierpost May 29 '15 at 09:15
  • Try a [login script](http://superuser.com/a/65503/138343) or a [scheduled task](http://superuser.com/questions/258641/windows-7-home-how-to-configure-a-logon-script). – Karan May 29 '15 at 09:42
  • @Karan: I tried both; neither work. For the scheduled task, the problem seems to be that it has to run as SYSTEM and cannot access my screen. A login script doesn't work at all (not even one that just echoes a line to a logfile). – reinierpost May 29 '15 at 11:05
  • That's strange. At least one of these should have worked, especially with a simple batch file. – Karan May 30 '15 at 00:17
  • I'm still looking for a solution. – reinierpost Oct 09 '15 at 13:17
  • I never found a solution. I use TimeSnapper now. – reinierpost May 21 '19 at 09:36

0 Answers0