Program that will restart an application?

ctwilliams

Active Member
I recently purchased an Apple TV so I could easily watch video podcasts on my tv. It does that very well, but Apple has made some inexplicable design decisions and I am trying to overcome one of them.

You can manually download podcasts using the Apple TV, however if you want to automatically download them you have to use Itunes. That works well, Itunes will faithfully check for new podcasts whatever time interval you choose.

What Itunes will not do is automatically sync the new podcasts it has just downloaded to your Apple TV. You either have to manually ask it to sync by pressing a button or it will do it when the program starts.

I am looking for a program that will end Itunes and then restart it on some type of schedule. I have found a few programs to restart a program that has crashed or ended, but nothing that will end a program.

I found this program: Link but before I purchased it I was going to see if there was anything (of course) free.

Has anyone seen anything that would do that?

Thanks for any ideas..

CT
 
You could use a application called KILL.exe which comes from microsoft. I think there are various sites online where you can download it or it comes with the support pack of win2k server cd. You could also go to www.sysinternals.com (now owned by microsoft) and download PSKILL which is another variation of that original kill file. Both are very small command line utils for killing processes... the PSKILL one is for killing processes remotely but also will kill local processes.

Then open notepad and put in the following five lines and save it as a batch file (restartITunes.bat)

@ECHO OFF
Kill.exe <servicename>
Ping.exe 127.0.0.1 -n 10 >NUL <---- this line is to make it wait 10 seconds before starting itunes up again.
Start <path to itunes executable
Exit

so for example

@ECHO OFF
Kill.exe Itunes.exe
Ping.exe 127.0.0.1 -n 10 >NUL
Start C:\program files\itunes\itunes.exe
Exit

I don't know the specific service name or paths in that example. This also assumes that kill.exe and the batch file are in the same folder.

Then you can put the batch file in windows scheduler and have it run on whatever schedule you'd like.

Sometimes windows scheduler doesn't run batch files correctly so I just use another ping command to make it wait some period of time and then start over again... basically the batch file runs continuously.
Example:

@ECHO OFF
:START
Kill.exe Itunes.exe
Ping.exe 127.0.0.1 -n 10 >NUL
Start C:\program files\itunes\itunes.exe
Ping.exe 127.0.0.1 -n 28800 >NUL
GOTO START
Exit

The above would restart itunes every 8 hours.

This is certainly not the most elegant way to do what you're trying to do but hey it's free and it works.

Kyle
 
I assume you are talking about the XP platform? If so, XP comes with a command called taskkill.

Example: taskkill /im:itunes.exe
 
Back
Top