Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

how to call this perl file repeatedly after every minute from batck file

by ppp (Acolyte)
on Jan 13, 2015 at 19:08 UTC ( [id://1113126]=perlquestion: print w/replies, xml ) Need Help??

ppp has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to call a perl file (w3.pl) repeatedly after every minute by double clicking in BATCH FILE (final.bat)

My try to do is below. It runs once fine but never repeats after every 1 minute. How to make it repeat after every 1 minute ?

schtasks /create /tn "batch Script" /tr C:\shekhar_Axestrack_Intern\Wi +ndowCreation\final.bat /sc minute /mo 1 perl C:\shekhar_Axestrack_Intern\WindowCreation\w3.pl
  • Comment on how to call this perl file repeatedly after every minute from batck file
  • Download Code

Replies are listed 'Best First'.
Re: how to call this perl file repeatedly after every minute from batck file
by Corion (Patriarch) on Jan 13, 2015 at 19:18 UTC

    Why do in a batch file what you can do in a(nother) Perl program?

    while (1) { system($^X, '0w3.pl') == 0 or warn "Couldn't launch w3.pl: $! / $^E"; sleep 60; };
Re: how to call this perl file repeatedly after every minute from batck file
by GotToBTru (Prior) on Jan 13, 2015 at 22:13 UTC

    Not a Perl question, is it? You just need to get the syntax of the schtasks program right.

    Dum Spiro Spero
Re: how to call this perl file repeatedly after every minute from batck file
by jonadab (Parson) on Jan 14, 2015 at 12:56 UTC

    Yet another way to do it: have the batch file call itself after one minute:

    perl w3.pl perl -e ' sleep 1; ' final.bat

    This is closer to what you actually asked for. With that said, this isn't what I'd do, if it were me. Corion's approach is closer to what I would do, if it were me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1113126]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-18 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found