Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: HTML application .HTA
I did some testing using different ways to call the application:
Test #1 : run(myHTAfile, '') Test #2 : runwait(myHTAfile, '') Test #3 : procid = RunShell(myHTAfile, "", "", @NORMAL, @GETPROCID) Test #4 : ShellExecute(myHTAfile, "", "", @NORMAL, "")Only Test #4 sucessfully launches the application.
Has anyone encountered such problems?
I could use ShellExecute but would be stuck without any "wait" option...
Apparently MSFT changed the registry entries for '.hta' files a bit, by adding a couple of additional parameters to the shell\open\command key. Of course WinBatch will faithfully use those parameters when it attempts to start mshta.exe. Not sure what MSFT intended but the parameters do appear to have an untoward effect on running the exe as a desktop application. It appears to be an isolated problem but we will have to look into this a bit further. Here atre some possible alternate solutions:
Option 1: Use ShellExecute then a WinWaitClose to handle the wait.
Option 2: Run mshta.exe and pass the htafile as parameter.
Run("mshta.exe", myHTAfile) RunWait("mshta.exe", myHTAfile) RunShell("mshta.exe", myHTAfile, "", @NORMAL, @GETPROCID)
Article ID: W18444
Filename: Run HTA File Problem.txt
File Created: 2012:11:26:09:49:54
Last Updated: 2012:11:26:09:49:54