Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer
1  
You can find py2exe here. –  jla Aug 24 '12 at 23:23

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.