in reply to How to set Parameter for a .pl in Windows Task Scheduler?

Without having seen your actual entries in the Task Scheduler, I guess that the problem stems from your way of calling the Perl script.

I guess that you put a direct link to the Perl script into the task entry - try replacing that with the path to Perl.exe and put the script as the first parameter after that:

"d:\perl\bin\perl.exe" "d:\scripts\test.pl" arg1 arg2 arg3

Then, the parameter passing should work.

perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

Replies are listed 'Best First'.
Re: Re: How to set Parameter for a .pl in Windows Task Scheduler?
by TeddyC (Novice) on Sep 24, 2003 at 12:24 UTC
    Thank you Corion!
    Your guess is correct, but i still wonder why it can't find perl.exe(i 've already writen in header)
    anyway, it runs now.
      Very simply put, Windows does not understand the shebang (#!) line. That is a Unix-only convention. I would suggest checking the docs that come with ActiveState Perl about commandline usage. Look at the "Perl/html/faq/Windows/ActivePerl-Winfaq4.html" document, it should have most if not all of the answers you might be looking for in this matter.

      Hope that helps. Happy reading :-)


      "Ex libris un peut de tout"