1

How to display my hta application name in task manager instead of displaying "Microsoft (R) HTML Application host" when it runs?

Also, how to show an icon in the task manager instead of default hta icon?

3
  • 1
    Write an application. Sep 21, 2013 at 11:11
  • 1
    Where? Is hta programming not writing an application?
    – Gem
    Sep 21, 2013 at 13:14
  • actually, it's process name in task manager is Microsoft (R) HTML Application host and that is a name for mshta.exe executable file which is running from C:\Windows\System32 (if you are in 64bit System) May 28, 2019 at 0:13

1 Answer 1

2

That's a very good question, especially if you have a lot of HTAs, as I do.

My solution was to associate the .hta file extension with a script instead of MsHta.exe. This script gets the Hta name and args from the command line. It then creates a copy of MsHta.exe in a folder dedicated to such copies and gives it the name of the Hta. Finally it runs the copied .exe with the hta name and args.

For instance, my modem status checker, ModemStatus.hta, is executed by a copy of MsHta.exe which is called ModemStatus.hta.exe - and that's what appears in Task Manager.

This method necessarily proliferates copies of MsHta.exe, which is why I put them all in a dedicated folder. Naturally, the folder is checked to see whether it already has a copy rather than creating a new one each time an Hta is run. I originally tried it using hard links but they all resolved to MsHta.exe so copies are necessary.

I say "associate the .hta file extension with a script" but mine is actually an exe compiled from an AutoIt script. AutoHotKey would work just as well, and can also be compiled to an exe, but you could probably also do the job using something written as a WScript.

You must log in to answer this question.

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