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

  • SEARCH
  • Home
  • 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 8059545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:42:17+00:00 2026-06-05T09:42:17+00:00

I have two bat scripts: A.bat and B.bat. A.bat generates a txt file (year.txt)

  • 0

I have two bat scripts: A.bat and B.bat. A.bat generates a txt file (year.txt) that contains the last year of simulation, such as 2005.

I want the A.bat to check the year.txt every 30 seconds. If the year.txt shows 2005, then the A.bat will call the B.bat.

Please teach me how to do this. Thanks a lot.

  • 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-06-05T09:42:19+00:00Added an answer on June 5, 2026 at 9:42 am

    To check every thirty seconds, simply use sleep:

    while true; do
        if test "$(cat year.txt)" = "2005"; then
            B.bat
        fi
        sleep 30
    done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two problems which are related. 1) I have a batch file that
I have a batch file, 'buildAll.bat', that builds a set of projects. It will
I want to find any file that can match two regular expressions, for example
I have two batch file bat1.bat and bat2.bat I need to write another batch
I have two application that need to talk to each other. App1 needs to
Basically I have two applications: a PHP web application that runs over Apache and
Using Windows XP, I created a batch-file that takes two files as arguments, and
Say I have a trait that has two lists. Sometimes I'm interested in the
i have 3 maven project (starto.commons,starto.hibernate,starto.server) that use some same dependencies and two of
I have batch file that I am inheriting and I cannot get to work

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.