simple command prompt one line into exe - command

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.

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.

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)

Related

How to track the progress of command executed using Start command

Consider an command which has to be executed more than once at the same time, I have created a bat file in which Start command is used to execute the command multiple times at once. But there are couple of problem I am facing,
After starting all the commands the main batch file is closed. It is not waiting until the new command window has done its job.
We are not able to keep track of the progress in new windows, for example consider the commands are executed from team city(CI) then the progress is not tracked.
Please help me on this, Thanks in Advance!
1) - Use START "" /WAIT, than start command wait till started process terminate, than continue running batch file.

Run a bat file when a specific application is opened in Windows XP

I want to know how can we run a bat file when a specific application is opened?
Eg: I would like to run a bat file whenever mspaint is opened.
I have successfully performed this in Windows 7 and Windows 10 using Task Scheduler. But the task scheduler available in Win Xp is very basic.
You could use another batch file that runs on startup of windows. use while loop with an appropriate sleep to detect when Paint.exe runs.
then you could write more commands to do anything you want. For example, as you said, you could run another batch file...
I found this solution by an investigation of these topics:
Syntax for a single-line Bash infinite while loop
How to check if a process is running via a batch script
Batch program to to check if process exists

Is there a way to schedule a SikuliX script to run automatically?

I've managed to run the script from the command line thinking that i could possibly use windows Schedule Task to run it, but it doesn't run command prompt or anything. When i go and check the task it says it completed. Im running windows8. Any help would be appreciated.
You can make a .bat file to execute your sikuli sript. .bat files can be scheduled with Windows 8, but you may need to schedule that task as SYSTEM or as the admin.

Use cygwin to run a batch file and email results

I am new to using cygwin and don't really understand how the scripting of it works. Currently I am running it on Windows 7 and using task scheduler to do this inefficiently.
What I want to do is to run a .bat file already made that runs tests in the cmd line and than take the results of that test and email that people.
Some side notes:
1. It doesn't HAVE to be a batch file, from my reading I think maybe a .sh would be easier to run with bash. Being able to run it on CentOS would be even better, that way others can run if I leave.
2. This needs to run daily. I would like to run the batch file at around 10 am and give it an hour till the emailed results are sent, unless you can trigger the email when the .bat is done.
3. Every time I run this .bat file it saves the results to a .htm file and overwrites it every time the .bat is run.
Thank you
That could be in the crontab for a a centOS server (/etc/crontab)
0 10 * * * user cd /path/ && /bin/bash file.sh >> result_file
Is that what you needed ? Also, you can install Cron as a windows service with cygrunsrv

Error handling in sets of batch files running in Windows task scheduler

Let's say I have 5 batch files that run sequentially one after another (executed via the Windows task scheduler on a normal Windows XP PC):
Script1.bat
Script2.bat
Script3.bat
Script4.bat
Script5.bat
Suppose one of the scripts fail (an error condition is detected -- details on how this happens is not important for my question here). How do I stop the other scripts from running if they all run within the task scheduler? For example, if Script1.bat fails, I don't want to run Script2-5.bat. If Script3.bat fails, I don't want to run Script4-5.bat, etc.
I thought about writing a flag value to a temporary file that each script would read from. At the beginning of each script (except for the first one), it will check to see if the flag is valid. The first script would clear out this flag at the beginning each time these set of batch files run.
Surely there is a better way to do this or maybe there is a standard for how to handle this type of situation? Thanks!
Write a master.bat file that conditionally calls each of the scripts in sequence. Then schedule the master instead of directly scheduling the 5 scripts.
#echo off
call Script1.bat
if %errorlevel%==0 call Script2.bat
if %errorlevel%==0 call Script3.bat
if %errorlevel%==0 call Script4.bat
if %errorlevel%==0 call Script5.bat