Auto Scan directory/folder

Posted on 2011-10-20
Last Modified: 2015-04-03
On a Windows 2008 sever, how can I check for  the existence of a file in a folder continuously?  Is there a command in the OS to do this or is there a standalone tool that will do this for me?

I basically what to create a process to continuously scan a folder; when a file is place in this folder the process will automatically execute a script to ftp the file.

Any help would be Awesome!

Thank you.
Question by:ericmagee
    LVL 25

    Expert Comment

    You could write a batch file to perform this function however I caution that the existence of the file is not a good method to use to start the send.  All the data may not be there as soon as the file name is visible.  


    Author Comment

    @ pony10us.  Point taken. I will be sure to add an sleep or pause before transmission.

    When writing the batch file, How can I ensure the process is running continuously in memory?  In addition, what command would allow me to auto scan a folder/directory?

    Thank you.
    LVL 25

    Expert Comment

    "How can I ensure the process is running continuously in memory?"  Place it in the startup and the loop will keep it running unless someone ends the process through task manager.

    "what command would allow me to auto scan a folder/directory?" I would use an IF EXIST loop

    Should give you an idea to start with:


    IF EXIST C:<some file> CALL <ftp program>

    GOTO start

    You may want to search for a way to run it with out the window.  You can run it minimized or there are VBS and tools that will let it run invisible which should work for this function since it won't require human intervention.
    LVL 16

    Accepted Solution

    Here is a sample Robo-FTP script that will do exactly what you asked:

    You can install Robo-FTP scripts to run as a Windows Service so it will be running all the time and be automatically restarted by the operating system if the computer reboots.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Too many email signature updates to deal with?

    Are you constantly visiting users’ desks making changes to email signatures? Feel like it’s taking up all of your time? Wish you could manage all signatures from one central location, easily design them and deploy them quickly to users? Well, there is an easy way!

    A list of useful business intelligence software.
    Skype is a P2P (Peer to Peer) instant messaging and VOIP (Voice over IP) service – as well as a whole lot more.
    To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
    This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now