Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Backgrounding a scheduled task

by beretboy (Chaplain)
on Aug 05, 2006 at 21:57 UTC ( #565820=perlquestion: print w/ replies, xml ) Need Help??
beretboy has asked for the wisdom of the Perl Monks concerning the following question:

I have written a perl script to do some fairly lengthy operations at boot up via the Windows XP scheduled tasks daemon. This will be running in a computer lab, and I don't want users to close the terminal window that currently pops up on boot. How can I run my script in the background, preventing it from opening a command prompt window?

"Sanity is the playground of the unimaginative" -Unknown

Comment on Backgrounding a scheduled task
Re: Backgrounding a scheduled task
by Corion (Pope) on Aug 05, 2006 at 22:00 UTC

    Start it with wperl.exe instead of perl.exe, assuming that you have ActiveState Perl.

    Your users still can kill this task via the task manager or other programs if they have the according privileges. You should consider running your programs as a different user than the logged on user if you want to prevent that.

      Iam using ActiveState, and I actually tried the wperl suggestion (someone told me earlier in the CB) and it doesn't seem to work. I get a "Could not start" message when I schedule the following task: wperl C:\bootscript\ Thanks for reminding me to run this as a different user, I've done that now.

      "Sanity is the playground of the unimaginative" -Unknown

        Perhaps a silly question, but is wperl.exe on the path and accessable to the user?

        DWIM is Perl's answer to Gödel
Re: Backgrounding a scheduled task
by GrandFather (Cardinal) on Aug 05, 2006 at 23:27 UTC
Re: Backgrounding a scheduled task
by sgifford (Prior) on Aug 06, 2006 at 14:28 UTC
    You could try having a very small perl script which simply ran:
    On Windows, the leading 1 should cause the script to run in the background, and your foreground script can immediately exit. Untested, but worth a try anyways...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://565820]
Approved by GrandFather
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-07-22 20:08 GMT
Find Nodes?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:

    Results (126 votes), past polls