0

I am using a piece of software written in Python and am using the Task Scheduler in WHS2011 to run it as a background process. Unfortunately it appears as "pythonw.exe" in the task list. It doesn't cause me a massive problem, but it would be nice if I could tell it what process name to use.

Is this possible via the command line to pythonw.exe?

1

2 Answers 2

2

No, it is not currently possible to set the task manager image name via a command line switch to pythonw.exe. Issue 5672 and others cover discussions about doing so.

There are some projects focused on making this possible from within your python program, like py-setproctitle. I haven't played around with them.

The Java solution is to create a launcher, either one that embeds all the Java code with the bootstrap interpreter into one exe or one that acts like java(w).exe and points to your Java classes. There are similar projects to do the same for Python like py2exe.

A simpler way to change the image name and "make your own launcher" is to make a copy of pythonw.exe named whatever you like, eg. mytask.exe. I have tested this with the copy/renamed exe in the PythonNN directory and in other directories and it runs fine and changes the Image Name in Task Manager. I haven't tested it from Task Scheduler in WHS2011.

1
0

No. Unlike ps in Unix, the "Image Name" field in Task Manager and other process management programs always contains the executable's name.

To get around this, you could create a symlink myapp.exe in the Python directory, and point to pythonw.exe.

2
  • 1
    this doesn't change the name in the "Image Name" column, it still says "pythonw.exe". oh well. May 23, 2012 at 8:11
  • I'm not quite sure why this answer got an upvote when it clearly doesn't work! May 23, 2012 at 8:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .