jefhal Posted October 9, 2005 Posted October 9, 2005 (edited) Here's a way to get a screen capture of a remote machine. You need the command line and script below, plus psexec.exe from Sysinternals, and Irfanview:psexec -c -d -f -i -u username \\targetmachine sendprintscreen.exeSendPrintScreen.exe =send("{PRINTSCREEN}") FileCopy("\\mymachine\shareddocs\i_view32.exe","\\targetmachine\c$\temp") runwait("c:\temp\i_view32.exe " & "/clippaste /convert=\\mymachine\shareddocs\test.gif") Exit Edited October 9, 2005 by jefhal ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Dr.Chi Posted January 27, 2006 Posted January 27, 2006 I wrote a very similar thing a while back. In my code, I put everything into variables, and passed those variables in an ini that gets compiled on the fly with the second script. It's a little bloated but the variables makes it really useful without editing code. The second script has the trayicon hidden for secret screen prints , but you can easilly unhide it. Note that several lines could be removed if you use FileCopy instead of me using XCopy. I think at the time I was having trouble with FileCopy not working, so I said "screw it" and threw in xcopy. Here's my code. Note that I only compile the fist script to an EXE, the second one is compiled on the fly. sendprintscreen1.au3 (.exe) = FileInstall ("D:\scripts\AutoIt Scripts\Aut2Exe\Aut2Exe.exe",@TempDir & '\Aut2Exe.exe',0) FileInstall ("D:\scripts\AutoIt Scripts\Aut2Exe\AutoItSC.bin",@TempDir & '\AutoItSC.bin',0) FileInstall ("D:\scripts\AutoIt Scripts\Aut2Exe\upx.exe",@TempDir & '\upx.exe',0) FileInstall ("E:\share\psexec.exe",@TempDir & '\psexec.exe',0) FileInstall ("D:\scripts\AutoIt Scripts\sendprintscreen2.au3",@TempDir & '\sendprintscreen2.au3',0) $target = InputBox("Question", "What's the target machine's IP?", "0.0.0.0", "") $whatletter = InputBox("Question", "What temporary drive letter do you wish to use?", "Y", "") $whatshare = InputBox("Question", "What location would you like the print screen file to be saved to?", "\\fmcnswks07\share", "") $whatuser = InputBox("Question", "What username would you like to use (must have access to the share you just entered)?", "cshannon", "") $whatpass = InputBox("Question", "What password is used for the above username?", "pass", "") $driveletter = IniWrite ( "C:\sendprintscreensettings.ini", "SendPrintScreen", "driveletter", $whatletter ) $sharelocation = IniWrite ( "C:\sendprintscreensettings.ini", "SendPrintScreen", "sharelocation", $whatshare ) $username = IniWrite ( "C:\sendprintscreensettings.ini", "SendPrintScreen", "username", $whatuser ) $password = IniWrite ( "C:\sendprintscreensettings.ini", "SendPrintScreen", "password", $whatpass ) SLEEP (2000) runwait (@TempDir & "\Aut2Exe.exe /in " & @TempDir & "\sendprintscreen2.au3 /out " & @TempDir & "\sendprintscreen2.exe /comp 2 /nodecompile") SLEEP (5000) runwait (@TempDir & "\psexec -c -d -f -i \\" & $target & " " & @TempDir & "\sendprintscreen2.exe") SlEEP (5000) FileDelete (@TempDir & "\Aut2Exe.exe") FileDelete (@TempDir & "\AutoItSC.bin") FileDelete (@TempDir & "\upx.exe") FileDelete (@TempDir & "\psexec.exe") FileDelete (@TempDir & "\sendprintscreen2.au3") FileDelete (@TempDir & "\sendprintscreen2.exe") sendprintscreen2.au3 = AutoItSetOption ( "TrayIconHide", 1) FileInstall ("E:\share\i_view32.exe",@TempDir & '\i_view32.exe',0) FileInstall ("C:\WINDOWS\system32\xcopy.exe",@TempDir & '\xcopy.exe',0) FileInstall ("C:\sendprintscreensettings.ini",@TempDir & "\sendprintscreensettings.ini",0) $timenow = @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC $driveletter = IniRead ( @TempDir & "\sendprintscreensettings.ini", "SendPrintScreen", "driveletter", "Y" ) $sharelocation = IniRead ( @TempDir & "\sendprintscreensettings.ini", "SendPrintScreen", "sharelocation", "C:\" ) $username = IniRead ( @TempDir & "\sendprintscreensettings.ini", "SendPrintScreen", "username", "cshannon" ) $password = IniRead ( @TempDir & "\sendprintscreensettings.ini", "SendPrintScreen", "password", "pass" ) Send("{PRINTSCREEN}") RunWait(@TempDir & "\i_view32.exe " & "/clippaste /convert=" & @TempDir & "\screen" & @ComputerName & $timenow & ".gif") SLEEP (5000) $source = @TempDir & "\screen" & @ComputerName & $timenow & ".gif" $dest = $driveletter & ":\*.*" DriveMapAdd($driveletter & ":", $sharelocation, 0, "FMC\" & $username, $password) RunWait(@ComSpec & ' /c ' & @TempDir & '\xcopy.exe ' & $source & ' ' & $dest, '', @SW_HIDE ) SLEEP (5000) DriveMapDel( "Y:" ) FileDelete (@TempDir & "\i_view32.exe") FileDelete (@TempDir & "\xcopy.exe") FileDelete (@TempDir & "\screen" & @ComputerName & $timenow & ".gif") FileDelete (@TempDir & "\sendprintscreensettings.ini") Exit
sPeziFisH Posted January 27, 2006 Posted January 27, 2006 You could also use LazyCat's Capture_Screen_dll to get this thing working without IrfanView - it's a bit easier and more slim in my opinion.
jefhal Posted February 17, 2006 Author Posted February 17, 2006 You could also use LazyCat's Capture_Screen_dll to get this thing working without IrfanView - it's a bit easier and more slim in my opinion.I looked at the link you included, but I could not tell from the link if this dll works on any remote machine? My program was made to get a screen capture of a remote machine primarily. ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Reaper HGN Posted May 10, 2006 Posted May 10, 2006 Here's a way to get a screen capture of a remote machine. You need the command line and script below, plus psexec.exe from Sysinternals, and Irfanview: psexec -c -d -f -i -u username \\targetmachine sendprintscreen.exe SendPrintScreen.exe = send("{PRINTSCREEN}") FileCopy("\\mymachine\shareddocs\i_view32.exe","\\targetmachine\c$\temp") runwait("c:\temp\i_view32.exe " & "/clippaste /convert=\\mymachine\shareddocs\test.gif") Exit Jefhal, I think this is a good idea and definitely needed. I had a similar need. What I wanted was something that customers I can not get remotely connected to could run and have a screenshot of their current desktop either emailed to me or sent via a post method to a website. In this way, I could walk them through disabling their firewall or opening a port so I could eventually get remotely connected. For this, I found some .NET code that has one purpose. It will inspect the clipboard and if there is an image there, it will write it to a file. Otherwise, it doesnt do anything. Then I wrap this with a 2 line minimum Autoit Script that presses the printscreen and then runs the clip2image to create the image file. I have some more code that uses blat to email it to me, or post it to a php page on my website so I can quickly view the pic of their desktop (I stripped that stuff out for understandability). Here is the AutoIt code send("{PRINTSCREEN}") RunWait("clip2image.exe","",@SW_HIDE) I am also including a zip file with the clip2image.exe file.clip2image.zip
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