1
votes

I want to capture some pc screen every day for few hours. I found vlc is the best why to do it and so I've made 2 bat files to start and stop the capture and scheduled them with ms scheduler.

sometimes it works but most of the time the app crashes..

this is the start recording bat:

"C:\vlc-2.1.0\vlc.exe" --qt-start-minimized screen:// :screen-fps=10 :screen-mouse-image=C:\vlc-2.1.0\mouse.png :sout=#transcode{vcodec=divx,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:std{access=file,dst=C:\Captures\session-%date:~7,2%%date:~4,2%%date:~10,4%.mp4} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep :rc-fake-tty

and this is the crash I get: Exception Code: c0000005

pls help

1
Error C0000005 means an ACCESS_VIOLATION occurred. Most likely your scheduled task (or scheduled task user) does not have the necessary privileges to write to a specified file location.David Ruhmann
Even though I'm the admin?Marianne

1 Answers

0
votes

Perhaps batch is not the right language for the job. What immediately coms to mind is VBScript. Try:

Set objShell = CreateObject("WScript.Shell") 
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()

'perhaps a loop of some kind here'
objShell.SendKeys "{PRTSC}" 'captures the screen'
WScript.Sleep 5000 'waits for 5 seconds'

objWord.Visible = True 'shows the document'
'here you could add the paste command'

This code printscreens and opens up a word document. You could modify the waiting time, paste it into the document etc. This is just an idea of what you could do. Batch is hardly ever a good language for hardware interaction. Something like a .exe or .vbs is much more practical.