How to display my hta application name and icon in task manager?

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?

Gem

Posted 2013-09-21T11:05:24.367

Reputation: 21

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) – ashkan nasirzadeh – 2019-05-28T00:13:12.207

1Write an application. – ta.speot.is – 2013-09-21T11:11:38.370

1Where? Is hta programming not writing an application? – Gem – 2013-09-21T13:14:39.307

Answers

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.

Peanut butter

Posted 2013-09-21T11:05:24.367

Reputation: 21