Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7695983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:40:27+00:00 2026-05-31T21:40:27+00:00

I have a very small office environment, and my team sends created pdfs to

  • 0

I have a very small office environment, and my team sends created pdfs to an sFTP server daily.

Occasionally, I will get a call that someone can’t log in to upload the files.

My normal course of action is to connect to the sFTP server myself, run a commmand like ls to determine it is responding.

I would like to be able to automate this with notification if there is a failure:

  1. Login to the sFTP server (with credentials).
  2. Run an LS command
  3. Email if connection times out or login fails.

I have limited experience with writing Batch files, but I can’t seem to figure a way to get only a ‘failed’ / no response to send an email.

Could anyone help with ideas? I’d like to run this as a VB or Batch in Scheduled Tasks, as I have a Server 2000 machine this could run on. I know batch has issue sending emails, but i have another batch file that uses Blat.exe to send an email with passed variables, so i could use that if i could get batch to send failed responses…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:40:29+00:00Added an answer on May 31, 2026 at 9:40 pm

    You should be able to do this with a batch file.

    Create a file called logon.ftp. This file contains the FTP logon script. Mine contains:

    open Ftp_server
    ftpuser
    ftppassword
    ls -l
    quit
    

    The testftp.bat file:

    ftp.exe < logon.ftp | grep "Not connected" > nul && call :alert_someone
    @echo Logon successful
    goto exit
    
    :alert_someone
    
    @echo %date% %time% > alert.txt
    @echo ftp_server appears to not be taking logins. >> alert.txt
    blat alert.txt -to you -from ftp_watcher -subject "alert %date% %time% ftp_server not taking logins"
    
    :exit
    

    You’ll need to get blat, and grep so you can do the string checking. My winxp ftp doesnt support errorlevels, so I’m using the errorlevel returned from grepping the ‘Not connected’ string to figure out if this worked or not.

    You can get wget or curl to do this as well, and they do support errorlevels.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At my company, we have a very small (<5) team. We build internal web
I have a very small VS2008 Winforms project that will not start. When I
I have a very small script to get all records from a database table,
i have a very small utilty app written in c# that works fine on
I have a very small form where a user can enter their zip code
I have a very small program: public static void main(String[] args) { Queue<String> queue
I have vales with very small difference like... 0.000001. I want to visualize them
I have to multiply a very small sized matrix ( size - 10x10 )
I have a requirement to change a very small part of the WPF ComboBox's
have small problem, and would very much appreciate help :) I should convert byte

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.