0

I have a perl script that I run from the command prompt: 3 times a day, the problem is now I need to run it every two hours. Im not going to be on an episode of lost so I need some help. Here is the command:

Perl C:/test/scripts/edi.pl

Does anyone know how this above one line command can be made into an executable (.exe) file so I can use the task scheduler to run?

If there is another way to do this with the task scheduler to run once every two hours every day then I could do that as well.

Thanks for your time.

user404705
  • 11
  • 2

2 Answers2

0

Can you not simply create a batch file that runs the script, and set that batch file to run every two hours? I know from a quick test there that I can schedule a batch file to run from Task Scheduler on Windows XP at least.

Stephen
  • 6,027
  • 4
  • 37
  • 55
  • Yes its an XP box but im not sure how to make a batch file – user404705 Jul 28 '10 at 15:47
  • Oh, I do apologise. Open up `notepad` and write the line you would normally write into your command prompt. Click File->Save As, and save it as `name.bat`. **Make sure to change the file type to "all types"!**. Then use the task scheduler as described. Though, if webdestroya is right and you can just run the perl script as a straight task, do that I guess! =] – Stephen Jul 28 '10 at 16:24
0

You can actually use the task scheduler to run that exact command without a batch.

The task scheduler should allow you to pass some arguments to the script without a problem (I have done this on a few Windows servers in order to have them run PHP scripts)

Mitch Dempsey
  • 38,725
  • 6
  • 68
  • 74