Batch Script

Posted on 2009-04-17
Last Modified: 2012-06-27
I like to write a  window batch script that will run  after every hour.
Suppose the name of my batch script is : st.bat,  and script  is in my machine's C:\ drive
Question by:zeinth
    LVL 12

    Expert Comment

    1) What is the script intended to do, i mean what do you want to acheive
    2) once the script is complete, you can use the windows scheduler to  to run the script every hour.


    Author Comment

    I doubt that through window scheduler  tool we can run script for every hour for Indefinite period.
    LVL 5

    Expert Comment

    Windows scheduler is intented Exactly for Your task. And it has all needed options to precise control over the job execution time. It's true,  just try.
    LVL 4

    Assisted Solution


    You can run multiple schedule or set it on hourly basis.

    You can find more info at:

    I hope this helps

    LVL 95

    Expert Comment

    by:Lee W, MVP
    You can doubt it, but I've run a script every 5 minutes for the last 2 years on one server - it updates MRTG to show a graph of my internet throughput.  I use Scheduled Tasks.  And it's still running.  Is that "indefinite" enough?
    LVL 16

    Accepted Solution

    I agree with Mechanic_Kharkov.

    1) Head over to control panel - Start | Settings | Control Panel
    2) Run Scheduled Tasks by double-clicking it
    3) Using Windows Explorer, locate your batch file and drag-&-drop it from Explorer to the Scheduled Tasks' pane.
    4) In Scheduled Tasks, double-click your batch file task to edit it's properties.
    5) Under the Tasks tab, verify Run As points to the correct user and then Set the password.
    6) Under the Schedule tab, click Advanced, tick Repeat TAsk, set Every to 10 minutes and click OK
    7) click Apply. Type in a password if you are prompted for one and click OK twice.

    This should set your batch file to run every 10 minutes.

    Author Comment

    I got below solution from net, I think this script will work for me:
    schtasks /create /sc minute /mo 20 /tn "Security Script" /tr \\central\data\scripts\task.bat
    thanks all
    LVL 16

    Expert Comment

    If you have a solution, you may close this question. You can acceppt your own comment as your solution if that's the case.
    LVL 16

    Expert Comment

    Thank you.

    Kind regards.

    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!

    Join & Write a Comment

    I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now