1.

Solve : SCREEN CAPTURE?

Answer»

Is there any way with Batch Script or VBS to make a lil app that captures the desktops screen in a predefined time interval like every 3 seconds and then it saves each screen-shot somewhere in a timestamped .jpg file with the users name in the file name like:
2007_12_17___10;45;36__GUMBAZ__.jpg

Is this possible at al..??

This will be for an XP Pro PCI dunno but that'd be cool.Probably not. Not sure how to even attempt this in batch and the VBS manual specifically mentions "You cannot send the PRINT SCREEN key {PRTSC} to an application."

You might try Google. There are probably 3rd party applications that can do this.




That would be a great virus... Yah...This could be used in a malicious manner to steal information or invasion of privacy!

If you are trying to stop someone from doing something or going somewhere, its best to just BLOCK whatever is not acceptible than it is to PLANT this which is possibly illegal if not for recording your own computer useage habits with you as the operator aware of the recorded screen shots.

I use a TOOL called CamStudio for recording Windows GUI processes if that is your intention and you were just looking at a batch or other timed process because you were unaware of 3rd party tools already available.There was a way to capture the screen in VBS...I saw it somewhere on youtube...it worked pretty well.helpmeh, do you have the source code for that?

i have this task that i am doing once daily. capture screenoutput of a PROGRAM, open paint, paste, and resize the image to half, and save as jpg file, and then print.
it would be nice if i can do it in vbs instead of manually clicking here and there.Quote from: Reno on March 09, 2009, 11:51:31 PM

helpmeh, do you have the source code for that?

i have this task that i am doing once daily. capture screenoutput of a program, open paint, paste, and resize the image to half, and save as jpg file, and then print.
it would be nice if i can do it in vbs instead of manually clicking here and there.

I don't have the source...I saw it a while ago on youtube...but it automatically saves the captured image.yesterday i play around vbs, and finally have working code to capture screen.
if anyone still interested on how to do it, let me know, and i will share the code here. I could really use that.Quote from: Helpmeh on March 29, 2009, 05:13:43 PM
I could really use that.

here you go, helpmeh. the solution is not pure vbs.

Code: [Select]'captureie.vbs
d=year(date)*10000+month(date)*100+day(date)
with createobject("wscript.shell")
if not .appactivate("Internet Explorer") then
wsh.echo "Internet Explorer is in tray state or could not be found"
wsh.quit 1
end if

' .sendkeys "%{prtsc}":wsh.sleep 200 'not working

' .run ".\printscreen.exe screen",1,false
.run ".\printscreen.exe",1,false
.run "c:\windows\system32\mspaint.exe",1,false:wsh.sleep 1000

if .appactivate("untitled - Paint") then
'resize to 1x1 pixel & paste from clipboard
.sendkeys "^e1{TAB}1~^v"

'save as ".\ie yymmdd.jpg"
.sendkeys "^sie " & d & "{TAB}{DOWN 2}~~%yy"
else
wsh.echo "Failed to activate Ms Paint"
end if
end with


because there is something wrong with sending printscreen keystroke from vbs, i am using temporary solution by calling win32 api, "keybd_event". so create printscreen.exe with your favourite IDE. here is a sample with VB6.
Code: [Select]Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_SNAPSHOT As Long = &H2C

Sub Main()
If INSTR(VBA.Command$, "?") <> 0 Then
MsgBox "USAGE: " & App.EXEName & " [SCREEN]" & vbNewLine & vbNewLine & _
"Argument:" & vbNewLine & _
"Screen - capture entire screen " & vbNewLine & _
"If omitted - capture active window"
ElseIf UCase(VBA.Command$) = "SCREEN" Then
'entire screen
keybd_event VK_SNAPSHOT, 0, 0, 0
Else
'active window
keybd_event VK_SNAPSHOT, 1, 0, 0
End If
End Sub

i am still looking for a way to call win32 api EASILY from vbs.


Discussion

No Comment Found