Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to execute commands of batch file at timed intervals

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 27-03-2010
Member
 
Join Date: Dec 2009
Posts: 80
How to execute commands of batch file at timed intervals
  

I am using an acer aspire desktop installed with windows 7. I need to know how to execute commands of batch file at timed intervals. Because i want to execute certain commands after a certain interval of time this will. Have anybody needed this ever before i would really appreciate your help in this matter.

Reply With Quote
  #2  
Old 27-03-2010
Member
 
Join Date: Apr 2008
Posts: 1,944
Re: How to execute commands of batch file at timed intervals

Yes this is possible but it would have been somewhat more better if you have also posted the program so that i can implement on that program and could have posted the solution but i am unable to give you a solution without the codes. I will do the needful as soon as you post the bat file commands.
Reply With Quote
  #3  
Old 27-03-2010
Member
 
Join Date: May 2008
Posts: 2,283
Re: How to execute commands of batch file at timed intervals

For this you will have to make use of a loop and then execute the batch file it would be better if you also make use of the 'dir' command after about 30 seconds. Since this dir command is used very extensively when a user wants to run certain command at a certain time intervals hope you got the point.
Reply With Quote
  #4  
Old 27-03-2010
Member
 
Join Date: Apr 2008
Posts: 1,993
Re: How to execute commands of batch file at timed intervals

To perceive this i will suggest you to make use of the scheduled task. Since using the scheduled task you can repeat certain number of commands at frequent intervals. So simply go to the start menu and then click programs and select accessories and select the scheduled task. double click the add scheduled tab.
Reply With Quote
  #5  
Old 27-03-2010
Member
 
Join Date: May 2008
Posts: 2,373
Re: How to execute commands of batch file at timed intervals

I think you will have to place the batch file in to a loop and then execute the dir command after every 25 secs. This will help you to execute certain command after a certain interval of time. If you are not getting it still then try to concentrate on the program mentioned below.
  • START
  • REM (this will execute the MS-DOS dir after every 25 seconds)
  • dir
  • SLEEP 25
  • GOTO END
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #6  
Old 27-03-2010
Member
 
Join Date: Oct 2005
Posts: 2,385
Re: How to execute commands of batch file at timed intervals

I would like to give you an example which will help you to understand how to implement such programs try to go through the program below.

:run_batch
taskkill avg.exe
REM
sleep 30 (will pause the process for 30 seconds)
goto run_batch

I hope that this would have solved all your issue.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to execute commands of batch file at timed intervals"
Thread Thread Starter Forum Replies Last Post
Multiple commands for a batch file in a for loop? SANDESH49 Software Development 4 08-05-2012 10:40 AM
Execute a batch file on a remote computer? Chris D Windows Server Help 6 20-01-2011 10:09 PM
Batch File Commands Pratap Gad Operating Systems 3 30-07-2009 08:07 PM
Execute a batch file on remote host Hulicat Windows Server Help 5 20-06-2009 01:35 AM
Batch File to Refresh Network at regular intervals Baker Networking & Security 3 17-04-2009 10:40 PM


All times are GMT +5.5. The time now is 09:35 PM.