DOS batch file has to run hourly, except on weekends.

Posted on 2007-07-24
Last Modified: 2012-05-05
I need to run a DOS batch file hourly, except on weekends.  I think I can use the DOS SLEEP command to run it hourly (SLEEP 3600), but this isn't a very elegant solution and it doesn't stop on the weekends.  I could always stop it manually, but can anyone suggest a better way to approach this problem?  By the way, the batch file has to pull some information from a database and ftp it to another site.  My OS is XP Pro. Thanks for your input!
Question by:tedsini
    LVL 20

    Accepted Solution

    I recommend using the Windows Task Scheduler.

    In the Control Panel go to Schedule Tasks.  Then select Add a Scheduled Task.

    Follow the wizard and select browse to select the dos batch file.  Then select perform task weekly and select the days to run.  Follow the prompts to then end and select Open Advance Properties.

    In Advance Properties, click the Schedule tab.  Click the Advanced button.  In here select the Repeat task option and schedule it for every hour.  Let me know if you have questions.

    Author Comment

    Thanks,  I knew about the Scheduler but I thought it was limited to daily tasks.  I hadn't opened the "Advanced Properties"  tab.  The file works hourly now, as needed.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
    Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 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

    9 Experts available now in Live!

    Get 1:1 Help Now