Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top