somabc Posted July 7, 2008 Posted July 7, 2008 Does anyone know if you can capture the remote screen (XP) using WMI or similar?
srochford Posted July 7, 2008 Posted July 7, 2008 Pretty sure that WMI won't but VNC does. What are you actually wanting to do?
strawberry Posted July 7, 2008 Posted July 7, 2008 got a very nice program taht does it automatically over vnc if its of use.
somabc Posted July 7, 2008 Author Posted July 7, 2008 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!
sahmeepee Posted July 7, 2008 Posted July 7, 2008 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. @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 1
Guest monkeyx Posted July 7, 2008 Posted July 7, 2008 (edited) 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. Edited July 7, 2008 by monkeyx
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now