Creating and Launching .HTA file

(imported topic written by sgreenwall91)

I’m trying to create and launch a .hta file using appendfile but haven’t been successful. The goal is to display a persistent message a user can not close/hide while having the formatting options available with HTA. It seams like I’m close but just can’t nail it down. The result is that the .hta file is created but I’m not actually able to run it from the script. My actionscript looks something like this:

delete __appendfile

delete message.hta

appendfile

appendfile

appendfile Update to your PC

appendfile

appendfile

appendfile <HTA:APPLICATION

appendfile SysMenu=“No”

appendfile >

appendfile

appendfile

appendfile

appendfile

appendfile

Please close all open Applications. Your system is now being updated. Your system will be restarted on completion. Thank you for your patience. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message in Spanish/French/etc

appendfile

appendfile

move __appendfile message.hta

Run message.hta

*I’ve tried using mshta.exe and the name of the file to launch. I’ve also considered using runascurrentuser but abandoned that also.

(imported comment written by BenKus)

If you double-click on the .hta file, does it work?

It might be an issue of the path… Try changing the command to:

run “{pathname of file “mshta.exe” of system folder}” message.hta

Ben

(imported comment written by sgreenwall91)

Yes, double clicking it works. It also works from command prompt under users and system context. Changing the path didn’t help. The action runs, shows “completed” but the message box never displays on the client PC. I also tried RunAsCurrentUser.exe (I copied the app to system32 to test) using:

run “{pathname of file “RunAsCurrentUser.exe” of system folder}” “{pathname of file “mshta.exe” of system folder}” message.hta

This produces the same result of no message window. As with the previous syntax, MSHTA.exe runs in task manager but this time, of course, it runs under the user context instead of system.

(imported comment written by BenKus)

Hey sgreenwall,

It looks like the .hta file is not interacting with the desktop… I am not sure how to solve this but maybe you can find a special option.

Ben

(imported comment written by sgreenwall91)

This did the trick…

wait __Download\Runascurrentuser.exe --r {pathname of file “mshta.exe” of system folder as string} “{(pathname of client folder of current site as string) & “\message.hta”}”