Run .HTA files from Custom Tools

To run a .hta application from custom tools you will need to call MSHTA.EXE from your %WINDIR%\System32 directory. An example would be:

%WINDIR%\System32\mshta.exe C:\Temp\RemoteUninstall.hta %TARGET%

CustomTool-HTA.png

In the example above I have a Custom Tool defined which will run the RemoteUninstall.hta utility from my local C:\Temp directory. Since this particular .hta file expects the name of a computer to be passed as the first argument (parameter) I specify the variable %TARGET%. This way when I run this Custom Tool from Inventory the selected computer will be passed to the .hta file.

Was this article helpful?
Still have a question or want to share what you have learned? Visit our Community Discord to get help and collaborate with others.