How do I automate the execution of a perl script in Windows 7/2008?
I want to execute a perl script every week or so. I've looked at the Task Scheduler but all it does when I 开发者_开发问答select the .pl file and run the task is open the .pl file in notepad++. I then tried having Task Scheduler run a .bat file:
perl goto.pl
It works when I double click it on the desktop (which is where I'm working off of) but only flashes a command prompt screen when I run the task. I googled extensively and many people had this problem and the solution seemed to be "change the permissions" or "add the full pathname to perl.exe and the .pl file without quotes around them". The files and the desktop folder all have full control/permissions and I am an admin account so that doesn't seem to be the solution. My perl script outputs to a text file which I would like to have automatically emailed to a distribution list every week but that's a challenge for later. Thank you.
You can change the current working directory in a .bat file, which seems to be the problem.
cd c:\directory\of\script\
perl goto.pl
Or you can use full path names, as you suggested yourself in the question.
精彩评论