For backward compatibility, 64-bit Windows ships with two versions of MSHTA.exe:
C:\Windows\SysWOW64\mshta.exe and
C:\Windows\System32\mshta.exe
The behavior you describe is one of the curiosities about the 64-bit MSHTA.exe, it can't invoke 32-bit applications like MSG.exe. Note that the 64-bit command prompt at c:\windows\SysWOW64\cmd.exe will also fail to find MSG.exe.
To fix this, you can associate .hta files with the 32-bit MSHTA.exe, or create a simple batch file to start your HTA, START_MSG.cmd:
START C:\Windows\System32\mshta.exe C:\YOUR_PATH\MSG.hta
I've tested the HTA below with both the 64 and 32-bit versions of MSHTA.exe. The 64-bit version raises a "file not found" error, but the 32-bit version works.
<script language="Javascript">
var E, LineWriteTimerID
function execWithStatus(cmdLine){
E = new ActiveXObject("WScript.Shell").Exec(cmdLine);
LineWriteTimerID = window.setInterval("writeOutLine()",100);
E.StdIn.Close();
}
function writeOutLine(){
if(E.StdOut.AtEndOfStream) window.clearTimeout(LineWriteTimerID);
if(!E.StdErr.AtEndOfStream) txtResults.value += "ERROR: " + E.StdErr.ReadAll() + "\n";
if(!E.StdOut.AtEndOfStream) txtResults.value += E.StdOut.ReadLine() + "\n";
}
</script>
<textarea id=txtCmd style="width:90%" rows=1>MSG.exe</textarea>
<button onclick="execWithStatus(txtCmd.value)">Run</button>
<br><textarea id=txtResults style="width:100%" rows=20></textarea>