16

I noticed when I press Ctrl+Alt+Del and click Task Manager, Windows calls taskmgr.exe /3 as the command. Several websites claim the Task Manager has no command line arguments.

Task Manager Processes in the Process Explorer

Why does Windows attach this argument?

2
  • 1
    Moreover, there's another, lesser weighting LaunchTM.exe in %windir%\System32 which makes it even more confusing as I could not figure out, basing on my google search as well, its purpose of existance and what it is good for in general.
    – user373230
    Commented Sep 30, 2016 at 19:00
  • @Chinggis6 There is no LaunchTM.exe in Windows 7, you are on Windows 8 I think. Why not creating a new question regarding this here on superuser? ;) Commented Oct 3, 2016 at 17:25

3 Answers 3

17

Analysis

Apparently it's not a documented behavior. I did some tests, and noted my findings:

  • Right-click the taskbar, and click Start Task Manager.

    "C:\Windows\system32\taskmgr.exe" /4
    
  • Press Ctrl+Shift+Esc.

    taskmgr.exe /2
    
  • Press Ctrl+Alt+Del, and click Start Task Manager.

    taskmgr.exe /3
    
  • Start a non-elevated Task Manager, and click the Show processes from all users button.

    "C:\Windows\system32\taskmgr.exe" /1
    
  • Type or paste taskmgr.exe in the Start menu search bar, and press Enter; press Win+R, type or paste taskmgr.exe in the textbox, and press Enter; navigate to the System32 folder and double-click the taskmgr.exe executable; start the System Configuration utility (msconfig.exe), click the Tools tab, select the Task Manager item from the list, and click Launch.

    "C:\Windows\system32\taskmgr.exe"
    
  • Open a command prompt, type or paste taskmgr.exe, and press Enter.

    taskmgr.exe
    

Remarks

  • Things worked in a similar way during the development phase of Windows 8, up until the Release Preview. Windows Vista and earlier operating systems are unaffected.

  • The executable imports a couple of API functions (namely GetCommandLineW and CommandLineToArgvW) which are used to retrieve and parse command line arguments.

  • Manually starting the program using any of the arguments above doesn't seem to have any noticeable effect.

If I had to make an educated guess, I'd say that the numeric parameter was meant to be an internal startup indicator, possibly used for debugging purposes and then left behind.

3
  • 10
    "taskmgr /7 /startup" => start with Startup tab in front! (Windows 8.1) -- but neither "taskmgr /startup /7" nor "taskmgr /startup" does that! (Extra credit: Please explain the command line parsing algorithm of taskmgr.exe given this evidence...)
    – davidbak
    Commented Jul 7, 2015 at 17:18
  • 3
    @davidbak taskmgr /anything /startup works, so /startup as the second argument. Commented Nov 14, 2017 at 7:59
  • @MicheldeRuiter - Yes. Would it have killed them to allow arguments in any order? Caused extra work in QA? Delayed the ship date? HUH????
    – davidbak
    Commented Nov 14, 2017 at 18:06
3

A few notes:

Just because a command is sent, does not mean that a program accepts those arguments, or any.

For example:

I called taskmanager with my own odd command and the behavoir did not change:

enter image description here

From a basic programming stand point, any application is going to have a main method of some sort where arguments can be passed in. For example a basic Windows Form C# application looks something like:

private void Form1_Load(object sender, EventArgs e)
        {

        }

If I pass some funny arguments in, nothing happens with the application, but Process Explorer will catch and display them.

enter image description here

If I explicitly decide to handle them however, you will get interaction from the command.

enter image description here

And all I had to do was change the entry point of the form slightly:

private void Form1_Load(object sender, EventArgs e)
        {
            string arguments = Environment.GetCommandLineArgs()[1];

            this.Text = arguments;
        }

Now, back to your question on why it is there:

If you access taskmgr.exe from the ctrl + alt + del method, you do indeed see the command argument "/3". Also if you use ctrl + shift + esc it passes /2 and if you right click the taskbar and click "Start Task Manager" the switch shown is /4.

All of this leads me to assume maybe there is something that Windows needs to know, or perhaps was nearly implemented for the Taskmanager that we don't know about. For example, security in Windows might want to know if ctrl + alt + del was used to call taskmgr.exe and not a script or user. Again, pure speculation but threads like this make me think it might have been at least a thought.


For the infamous tl;dr

To know why Windows passes these commands we likely need either a member of Microsoft's development team, or the source code. There might not be a better answer.

3

If I recall correctly, and it's hazy at best, I think I was providing myself a way to know through what mechanism I had been launched. So I'd know if it was coming from Ctrl + Shift + Esc vs the tray vs the start menu, etc.

Ultimately I think that info proved unnecessary, so it's probably ignored but still encoded in the behavior of those that launch it.

3
  • Hello, you should provide some more clear info in your answer.
    – Destroy666
    Commented Jun 13, 2023 at 20:00
  • 1
    @Destroy666 It's David Plummer, he wrote the TaskManager for Microsoft in 1996. Commented Jun 14, 2023 at 2:41
  • Oh, I see, I missed that. Nonetheless, some more info would be nice to see. This kind of confirms debugging purpose theory from other answer(s), but can't still be 100% sure.
    – Destroy666
    Commented Jun 14, 2023 at 3:27

You must log in to answer this question.

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