+ Post New Thread
Results 1 to 7 of 7
Scripts Thread, WMI Screen Capture in Coding and Web Development; Does anyone know if you can capture the remote screen (XP) using WMI or similar?...
  1. #1
    somabc's Avatar
    Join Date
    Oct 2007
    Location
    London
    Posts
    2,337
    Thank Post
    83
    Thanked 388 Times in 258 Posts
    Rep Power
    111

    WMI Screen Capture

    Does anyone know if you can capture the remote screen (XP) using WMI or similar?

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,144
    Thank Post
    113
    Thanked 518 Times in 447 Posts
    Blog Entries
    2
    Rep Power
    121
    Pretty sure that WMI won't but VNC does.

    What are you actually wanting to do?

  3. #3

    Join Date
    Mar 2007
    Posts
    1,669
    Thank Post
    72
    Thanked 249 Times in 199 Posts
    Rep Power
    64
    got a very nice program taht does it automatically over vnc if its of use.

  4. #4
    somabc's Avatar
    Join Date
    Oct 2007
    Location
    London
    Posts
    2,337
    Thank Post
    83
    Thanked 388 Times in 258 Posts
    Rep Power
    111
    I wanted to capture the screen via a script or command line if at all possible? Looks like its not (security issue?).

    I could try the VNC method instead, can you send me a link?

    Cheers!

  5. #5
    sahmeepee's Avatar
    Join Date
    Oct 2005
    Location
    Greater Manchester
    Posts
    795
    Thank Post
    20
    Thanked 69 Times in 42 Posts
    Rep Power
    33
    There's a commandline utility called lsgrab which will do it if that's what you're after.

    I have a batch file in my quicklaunch I can click on which will prompt me to enter a computer name and it then grabs the screenshot to a jpg and shows it me. Here's the script portion, which also needs the sleep utility from the resource kit to work properly. I've put my admin username into my shortcut to it to save some typing.

    Code:
    @echo off
    REM Grab a screenshot from a remote PC
    REM screengrab [adminusername] [hostname]
    
    IF "%1" == "" (
      SET /P varAdminUser=Enter your admin username, e.g. sahmeepee:  
    ) ELSE (
      SET varAdminUser=%1
    )
    
    IF "%2" == "" (
      SET /P varHost=Enter the hostname, e.g. computer69:  
    ) ELSE (
      SET varHost=%2
    )
    
    
    REM make a local directory to store the images
    if not exist c:\screenshots\nul mkdir c:\screenshots
    
    REM if we already have an image from this PC, delete it
    if exist c:\screenshots\%varHost%.jpg del c:\screenshots\%varHost%.jpg
    
    REM grab the image, cd variable is current directory
    runas /user:canon-slade\%varAdminUser% /noprofile "\\admin-file\public\ict team\Scripts\GrabRemoteScreen\lsgrab.exe /c:%varHost% /p:c:\screenshots\"
    
    
    REM nasty goto loop to wait for image to be created
    :tryImage
    REM has the image been created?
    if exist c:\screenshots\%varHost%.jpg (
      REM display the image with windows preview
      start rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen c:\screenshots\%varHost%.jpg
      goto exitScript
    ) ELSE (
      REM give the command a little longer to run and try again
      sleep -m 250
      goto tryImage
    )
    
    :exitScript

  6. Thanks to sahmeepee from:

    somabc (7th July 2008)

  7. #6
    monkeyx's Avatar
    Join Date
    Nov 2006
    Posts
    364
    Thank Post
    8
    Thanked 52 Times in 41 Posts
    Rep Power
    25
    I have gotten this to work via c# running a remote executable. It uses some WMI to help connect to get machine info etc. But as far I know WMI can not do the screen shot itself. I am using this to create a thumbnail viewer that will show screen shot of a range of machines every couple of minutes.

    I have also used lsgrab before and that is a great utility. psexec can also be used to run progams that can generate screen shots locally etc. then pipe the results back via a script.
    Last edited by monkeyx; 7th July 2008 at 08:32 PM.

  8. Thanks to monkeyx from:

    somabc (7th July 2008)

  9. #7
    somabc's Avatar
    Join Date
    Oct 2007
    Location
    London
    Posts
    2,337
    Thank Post
    83
    Thanked 388 Times in 258 Posts
    Rep Power
    111
    Thanks!

SHARE:
+ Post New Thread

Similar Threads

  1. Real Time Screen Capture
    By enjay in forum Windows
    Replies: 7
    Last Post: 11th February 2008, 01:06 PM
  2. Screen Capture
    By angelikaalston in forum How do you do....it?
    Replies: 11
    Last Post: 29th November 2007, 08:56 AM
  3. Screen Capture Software for Training materials
    By flyinghaggis in forum How do you do....it?
    Replies: 9
    Last Post: 7th September 2007, 09:00 AM
  4. JING - Screen capture software
    By mighty.grey.eagle in forum General Chat
    Replies: 12
    Last Post: 19th August 2007, 05:40 PM
  5. screen capture software
    By beeswax in forum Educational Software
    Replies: 12
    Last Post: 6th November 2006, 12:22 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •