Does anyone know, if it's possible to change the name of an other Program in the Taskmanager using C#? If yes how, cause I'm currently making a program, which searches Edge.exe and then i want it to change the name to Internet.exe
-
1@clemens I think he is asking something different... He is asking to change the name of what appears in TaskManager, not on the file system. – xanatos Jun 06 '18 at 09:32
-
1I don't think it is possible. – xanatos Jun 06 '18 at 09:32
-
Reopened this... – Wiktor Zychla Jun 06 '18 at 09:33
-
7Whatever problem this is meant to solve, it's unlikely to work... – bommelding Jun 06 '18 at 09:37
3 Answers
So you want to
change the name of an other Program
but your query is impresise because there is a difference between the process name and the application name. The first is taken from the executables version-info resource, and can in C# be accessed by
Process.ProcessName
which is a read-only property so you can't set it.
You can't set it using any other method either for obvious reasons. Only malware would want to disguise in such a way.
You can however change the application name instead of the process name because it is linked to the title of the processes main window.
e.g. to change it you could use
[DllImport("user32.dll")]
private static extern bool SetWindowText(IntPtr hWnd, string text);
private void ChangeEdgeToInternet()
{
foreach(Process process in Process.GetProcessesByName("Edge"))
{
SetWindowText(process.MainWindowHandle, "Internet");
}
}

- 4,845
- 5
- 29
- 65
You can't do it without doing some undocumented memory access. In the end the information shown by the TaskManager in the Name column is taken from GetModuleBaseName()
API. Clearly there is no SetModuleBaseName()
API. There is another similar API: GetProcessImageFileName ()
, still no set.

- 109,618
- 12
- 197
- 280
You can rename the executable file of the program. Hopefully this will help.
System.IO.File.Move(directoryPath+"\\Edge.exe", directoryPath+"Internet.exe");

- 17,178
- 6
- 29
- 58

- 175
- 12