Is this doable
kyosohma at gmail.com
Fri Mar 21 15:36:11 CET 2008
On Mar 21, 6:48 am, fkallgren <fkallg... at gmail.com> wrote:
> I have a little problem. I have a script that is in the scheduler
> (win32). But every now and then I update this script and I dont want
> to go to every computer and update it. So now I want the program to 1)
> check for new version of the script, 2) if there is a new version,
> copy that verision from server to local drive, 3) shutdown the program
> and start it up again as the new version.
> The problem is that I can't run this script directly from server so it
> have to run it locally.
> Anyone having any bright ideas??
You could create an update script that compares the md5 (or some
other) hash of the files for differences, kill the program if there is
a difference and do the copy. I don't understand why you can do it
from the server. I basically do the same thing from my workstation
when I update one of my programs.
To kill the process on a remote PC, I do the following:
subprocess.Popen('taskkill /s %s /im processName' % computer_name)
I actually don't restart mine since it will be started when the user
logs on. So I'll leave that to you. Of course, my program is made into
an executable, but it should work the same.
Maybe that will give you some ideas anyway.
More information about the Python-list