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 6691695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:46:53+00:00 2026-05-26T05:46:53+00:00

I have a batch file which calls a Perl file which requires a input

  • 0

I have a batch file which calls a Perl file which requires a input as a text file

CreateTasks.bat:

Createtask.pl -f %1

where %1 - "C:\task\TASK1234.txt"

The file TASKxxx.txt (ex : TASK1234.txt) will be create from another application and at any point the folder C:\task\’ can contain one more more Tasxxx.txt files

I want to Call the CreateTasks.bat once for each file, reason is that This folder will be filled in with the text file and this folder needs to be monitored.

How can I call achieve this?

I was thinking of scheduling a Batch file which runs every 5 mins. Get always the first file and call this batch file

is this good approach?

if something is not clear please do let me know and I will try to clarify

Thanks

Karthik

  • 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-26T05:46:54+00:00Added an answer on May 26, 2026 at 5:46 am

    You may use a BAT file that periodically loops over all the files of a given extension in a given folder, and for each such file found, it would invoke some special process and, if succesful, rename the file so it does not process it again. This simple code implements the main idea of this strategy, use it to get you started.

      @ECHO OFF
      SET TASKPATH=c:\temp
      SET TASKEXT=tst
      FOR %%A IN ("%TASKPATH%\*.%TASKEXT%") DO (
        ECHO DOMYTASK "%%A"  
        REN "%%A" "%%~nA.DONE"
      )
    

    But, watch carefully, as there are many traps in this road; to cite some, take care with the error processing, address possible issues with cancellation of processes, stalled executions, double or multiple executions, even in parallel, and consider race conditions in all the checks you might prepare.

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

Sidebar

Related Questions

I have NAnt script which as part of its project calls a batch file
I have a batch file which calls a java program. The output is redirected
I have a batch file that calls various commands, some of which will occasionally
I have a Batch file which will call a Powershell Script : BATCH FILE
I have a problem. I have a batch file which imitates the UNIX cd
I have a windows batch file in Windows 7 which does something with find.
i have a batch(backup.bat)file.in that i have written a command to create a backup
I have a batch file that creates a scheduled task using schtasks like this:
I have a batch file which initializes variables via SET inside a for loop,
I have a MSI installer custom action which calls Process.Start() to run a batch

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.