Your code works. I have an mp3 on my Desktop
and can load it with the following HTA:
'------------ begin hta----------------------
<HTML>
<HEAD>
<HTA:APPLICATION ID="Player">
<TITLE></TITLE>
<SCRIPT LANGUAGE="VBScript">
Sub window_onload()
Dim HTAPath, sCommand
Dim s, Pt1, iQ, i2, Q2
window.resizeto 400, 300
window.moveto 0, 0
s = Player.commandLine
Q2 = Chr(34)
iQ = 0
For i2 = 1 to Len(s)
Select Case Mid(s, i2, 1)
Case " "
If iQ Mod 2 = 0 Then
HTAPath = Left(s, i2 - 1)
HTAPath = Trim(Replace(HTAPath, Q2, ""))
If Len(s) > i2 Then
sCommand = Right(s, Len(s) - i2)
sCommand = Trim(Replace(sCommand, Q2, ""))
End If
Exit For
End If
Case Q2
iQ = iQ + 1
Case Else
'-
End Select
Next
MediaPlayer.URL = sCommand
End Sub
</SCRIPT>
</HEAD>
<BODY>
<OBJECT ID="MediaPlayer" Name="MediaPlayer"
style="margin: 0px; margin: 0px; position:absolute; LEFT: 0px; TOP: 0px;
width: 370px; HEIGHT: 270px;"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
<PARAM NAME="AutoStart" VALUE="false">
<PARAM NAME="enableContextMenu" VALUE="true">
<PARAM NAME="ShowControls" VALUE="true">
<PARAM NAME="AnimationAtStart" VALUE="false">
<PARAM NAME="TransparentAtStart" VALUE="false">
<PARAM NAME="ShowStatusbar" VALUE="true">
<PARAM NAME="AllowChangeDisplaySize" VALUE="true">
<PARAM NAME="AutoSize" VALUE="false">
</OBJECT>
</BODY></HTML>
'-------------------------- end hta -----------------
I can call it with the following VBScript:
'------------begin script----------------------
Set SH = CreateObject("WScript.Shell")
sh.Run "C:\windows\desktop\player.hta " & "C:\windows\desktop\wilsons
snipe.mp3"
Set sh = Nothing
'-------end script----------------------------
It's a bit clunky because the command line
for an HTA is a mess, but it works. It still
has a basic window frame, but I was able,
with someexperimenting, to get a pretty good
fit of WMP into the window.