Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: SCREEN CAPTURE  (Read 9153 times)

0 Members and 1 Guest are viewing this topic.

gumbaz

    Topic Starter


    Intermediate

    SCREEN CAPTURE
    « on: December 16, 2007, 11:31:37 PM »
    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 PC

    S_R_S5

    • Guest
    Re: SCREEN CAPTURE
    « Reply #1 on: December 16, 2007, 11:37:37 PM »
    I dunno but that'd be cool.

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: SCREEN CAPTURE
    « Reply #2 on: December 17, 2007, 05:13:01 AM »
    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.

     8)


    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    BatchRocks



      Hopeful
    • Thanked: 3
      Re: SCREEN CAPTURE
      « Reply #3 on: March 04, 2009, 05:00:06 AM »
      That would be a great virus...  >:(

      DaveLembke



        Sage
      • Thanked: 662
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: SCREEN CAPTURE
      « Reply #4 on: March 04, 2009, 10:47:29 AM »
      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.

      Helpmeh



        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: SCREEN CAPTURE
      « Reply #5 on: March 09, 2009, 03:07:48 PM »
      There was a way to capture the screen in VBS...I saw it somewhere on youtube...it worked pretty well.
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      Reno



        Hopeful
      • Thanked: 32
        Re: SCREEN CAPTURE
        « Reply #6 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.

        Helpmeh



          Guru

        • Roar.
        • Thanked: 123
          • Yes
          • Yes
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 8
        Re: SCREEN CAPTURE
        « Reply #7 on: March 10, 2009, 03:37:50 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.
        Where's MagicSpeed?
        Quote from: 'matt'
        He's playing a game called IRL. Great graphics, *censored* gameplay.

        Reno



          Hopeful
        • Thanked: 32
          Re: SCREEN CAPTURE
          « Reply #8 on: March 18, 2009, 10:16:07 PM »
          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.  :)

          Helpmeh



            Guru

          • Roar.
          • Thanked: 123
            • Yes
            • Yes
          • Computer: Specs
          • Experience: Familiar
          • OS: Windows 8
          Re: SCREEN CAPTURE
          « Reply #9 on: March 29, 2009, 05:13:43 PM »
          I could really use that.
          Where's MagicSpeed?
          Quote from: 'matt'
          He's playing a game called IRL. Great graphics, *censored* gameplay.

          Reno



            Hopeful
          • Thanked: 32
            Re: SCREEN CAPTURE
            « Reply #10 on: March 30, 2009, 10:25:15 AM »
            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.