Basj Basj - 1 year ago 157
Python Question

Make python process name more explicit

When I run the taskmanager, the process name for all Python scripts are the same :

. It makes it difficult to know which is which.

How to change the process name displayed by Windows task manager?

Note: this question doesn't seem to work for Windows.

enter image description here

Answer Source

Create a new file named python-by-name.bat in the python directory with the following contents:

set PYTHON_HOME=%~dp0
set PYTHON_NAME=%1.exe
copy "%PYTHON_HOME%\python.exe" "%PYTHON_HOME%\%PYTHON_NAME%"
set args=%*
set args=%args:* =%

Now, instead of typing:

python <arguments>


python-by-name my_program <arguments>

now my_program will appear in the taskmanager instead of python.

see Changing the process name of python script in windows for more details.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download