• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

automatic screen capture + ftp?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

medo145

Member
Joined
Jun 11, 2004
I'm looking for a program that will take a screenshot at a specified interval and then upload that file to a ftp location. I've looked and after installing 8 different ones claiming to do what i'm looking for, i decided to come here and ask if someone knows a program that will do just that. i found one that is 500$ and that's way too much if you ask me.

thanks
 
You are looking for 2 things, which are both freely available. This would be easier with open source software than it would be on windows, but its possible with simple scripts in windows with scheduled tasks.

Here is what you need:

1. save screenshot to a directory at set intervals
2. transfer files in a directory via ftp at set intervals

Use a scheduled task to run the script which takes the screenshot at a set interval (every 5 minutes). Use another scheduled task to run the script which FTPs the contents of the directory at a set interval (every 5 minutes, 1 minute after the screenshot script runs).

This is the script to FTP your stuff, but I'd modify it a bit to clean the directory after the file is FTP'd - that simplifies matters as you can tell the script to FTP everything in the directory (a single file) then once the FTP is complete delete contents of the directory so you are starting fresh the next go around.

Code:
Function FTPUpload(sSite, sUsername, sPassword, sLocalFile, sRemotePath)
  'This script is provided under the Creative Commons license located
  'at http://creativecommons.org/licenses/by-nc/2.5/ . It may not
  'be used for commercial purposes with out the expressed written consent
  'of NateRice.com

  Const OpenAsDefault = -2
  Const FailIfNotExist = 0
  Const ForReading = 1
  Const ForWriting = 2
  
  Set oFTPScriptFSO = CreateObject("Scripting.FileSystemObject")
  Set oFTPScriptShell = CreateObject("WScript.Shell")

  sRemotePath = Trim(sRemotePath)
  sLocalFile = Trim(sLocalFile)
  
  '----------Path Checks---------
  'Here we willcheck the path, if it contains
  'spaces then we need to add quotes to ensure
  'it parses correctly.
  If InStr(sRemotePath, " ") > 0 Then
    If Left(sRemotePath, 1) <> """" And Right(sRemotePath, 1) <> """" Then
      sRemotePath = """" & sRemotePath & """"
    End If
  End If
  
  If InStr(sLocalFile, " ") > 0 Then
    If Left(sLocalFile, 1) <> """" And Right(sLocalFile, 1) <> """" Then
      sLocalFile = """" & sLocalFile & """"
    End If
  End If

  'Check to ensure that a remote path was
  'passed. If it's blank then pass a "\"
  If Len(sRemotePath) = 0 Then
    'Please note that no premptive checking of the
    'remote path is done. If it does not exist for some
    'reason. Unexpected results may occur.
    sRemotePath = "\"
  End If
  
  'Check the local path and file to ensure
  'that either the a file that exists was
  'passed or a wildcard was passed.
  If InStr(sLocalFile, "*") Then
    If InStr(sLocalFile, " ") Then
      FTPUpload = "Error: Wildcard uploads do not work if the path contains a " & _
      "space." & vbCRLF
      FTPUpload = FTPUpload & "This is a limitation of the Microsoft FTP client."
      Exit Function
    End If
  ElseIf Len(sLocalFile) = 0 Or Not oFTPScriptFSO.FileExists(sLocalFile) Then
    'nothing to upload
    FTPUpload = "Error: File Not Found."
    Exit Function
  End If
  '--------END Path Checks---------
  
  'build input file for ftp command
  sFTPScript = sFTPScript & "USER " & sUsername & vbCRLF
  sFTPScript = sFTPScript & sPassword & vbCRLF
  sFTPScript = sFTPScript & "cd " & sRemotePath & vbCRLF
  sFTPScript = sFTPScript & "binary" & vbCRLF
  sFTPScript = sFTPScript & "prompt n" & vbCRLF
  sFTPScript = sFTPScript & "put " & sLocalFile & vbCRLF
  sFTPScript = sFTPScript & "quit" & vbCRLF & "quit" & vbCRLF & "quit" & vbCRLF


  sFTPTemp = oFTPScriptShell.ExpandEnvironmentStrings("%TEMP%")
  sFTPTempFile = sFTPTemp & "\" & oFTPScriptFSO.GetTempName
  sFTPResults = sFTPTemp & "\" & oFTPScriptFSO.GetTempName

  'Write the input file for the ftp command
  'to a temporary file.
  Set fFTPScript = oFTPScriptFSO.CreateTextFile(sFTPTempFile, True)
  fFTPScript.WriteLine(sFTPScript)
  fFTPScript.Close
  Set fFTPScript = Nothing  

  oFTPScriptShell.Run "%comspec% /c FTP -n -s:" & sFTPTempFile & " " & sSite & _
  " > " & sFTPResults, 0, TRUE
  
  Wscript.Sleep 1000
  
  'Check results of transfer.
  Set fFTPResults = oFTPScriptFSO.OpenTextFile(sFTPResults, ForReading, _
  FailIfNotExist, OpenAsDefault)
  sResults = fFTPResults.ReadAll
  fFTPResults.Close
  
  oFTPScriptFSO.DeleteFile(sFTPTempFile)
  oFTPScriptFSO.DeleteFile (sFTPResults)
  
  If InStr(sResults, "226 Transfer complete.") > 0 Then
    FTPUpload = True
  ElseIf InStr(sResults, "File not found") > 0 Then
    FTPUpload = "Error: File Not Found"
  ElseIf InStr(sResults, "cannot log in.") > 0 Then
    FTPUpload = "Error: Login Failed."
  Else
    FTPUpload = "Error: Unknown."
  End If

  Set oFTPScriptFSO = Nothing
  Set oFTPScriptShell = Nothing
End Function

Source: http://www.naterice.com/articles/51

To take the screenshot, create a scheduled task that issues the following command (you'll need to download and save screenkap somewhere, and you'll probably actually want this task to run a vbs so that filenames are unique otherwise you'll overwrite the file every time):
ScreenKap -file c:\screenshots\screenshot.jpg
http://www.mailsend-online.com/ScreenKapReadMe.htm

So in summary, I'd set a scheduled task at 12:00AM which runs this every 5 minutes:
ScreenKap -file c:\screenshots\screenshot.jpg

I'd set another scheduled task at 12:01AM which runs this every 5 minutes:
ftpupload.vbs (modify script I provided so that it uses proper ftp credentials and uploads the file in c:\screenshots\)
 
Last edited:
I've used Zscreen in the past, but never for FTP. Works good and I think you should give it a shot to see if it works. It is freely available and open source. One of the best screenshot programs I've see to date.

http://code.google.com/p/zscreen/
 
If you don't need it to a specific FTP and you just need it available on the net, you could use a folder sync solution like DropBox with an freeware screenshot program. Just save the screenshots into your DB directory.
Or you could use IMOG's solution. Seems pretty solid to me. But I don't really trust those guys with red names.... scary.
 
Heh, I think thats the best answer yet twigglish - saving the screenshots to a dropbox folder which is automatically synced makes a lot of sense, its accessible via the web and very flexible.

The FTP option would work, but its a bit archaic and will require some basic vbscript modifications.

I'd probably use a combination of thideras's suggestion and dropbox, because I think his screenshot app may also take care of incrementing or randomizing the file names - for your purposes, the file names probably don't matter as long as you have timestamps and can arrange the pictures by that. Depends partially on what your intent or goal is.
 
By default, the program grabs the program's name and adds the time/date after/before it.
 
IcyScreen does all of it, but it's 500$. Lol too much for a program that takes screenshots if you ask me.

programs that i remember by name

jet screenshot
faststone capture
hyper snap
snag it
snap shot

it does need to be a specific location, if this is doable by using 2 programs i'm up for it

how would i use the scheduler to take a screenshot every so often?

it should also save as the same filename each time.
 
Did you see my post? I made a suggestion.

You could add it as a schedule, giving it the flags needed to know how/where to save it.
 
Do you know how to create a scheduled task?

Create one, tell it to run every five minutes, and this is the command it should execute (download screenkap.exe and save it in windows\system32 first):
ScreenKap -file c:\screenshots\screenshot.jpg

That will take the screenshot and overwrite the old file every time, for however you set the scheduled task. You can change the directory it saves to however you want.
 
alright, i just tried the scheduled task, exe crashes. i'm at work and i'm using vista. this is going to be run on a server so i don't think that should be a problem

edit
nevermind, i'm a turd and i didn't put in the _isource.dll in the system32 folder

is it just me or are the screen shots this thing takes very yellow?
 
Last edited:
HFS.exe can act as it's own server running on whatever windows box stays on for the captures. It uses passworded folder/s of your choice containing whatever you want and they are accessible through any vga enabled browser with limited support for qvga.
Screenshot programs are free and easy. System Scheduler works for me when I really need to schedule something (and I get tsk schdlr issues).
Batchrun is also quite powerful but probably unnecessary.
http://www.rejetto.com/hfs/ HFS
http://www.splinterware.com/products/wincron.htm System Scheduler
 
Last edited:
well i managed to get hypersnap to do what i need it to by using a combination of command prompt and gui settings, BUT there is a problem, once i disconnect from the remote machine (not log off), all the uploaded pictures are completely black.

Any ideas why that is happening and what can i do to keep the gui session running?

thanks
 
there is a program running on a server that's generating information, i'm trying to display that information on a website. so every so often it will take a screen shot and then upload it to the web server and then the shot is embedded in the page. there is about 10 different users on the server. so someone would have to keep 10 remote desktop connections open for the thing to work. not very convenient.
 
Did reply number 3 with the VBscript do the job?

(I am looking to do the same thing you asked about medo145)
 
Back