Search code examples
hta

hta brings up view and track downloads message


I have a bunch of links to videos in a hta file and I want the links to open VLC media player in full screen to view them. This is what I have so far:

<HTML>
    <HEAD>
    </head>
    <body>
        <a href="file:///C:******\Video1.mp4">Video 1</a>
        <a href="file:///C:******\Video2.mp4">Video 2</a>
        <a href="file:///C:******\Video3.mp4">Video 3</a>
        <a href="file:///C:******\Video4.mp4">Video 4</a>
    </body>
</html>

This is working fine, but I get a "view or track downloads" window that pops up and asks me if I want to download the files or open it. If I select "open" it opens VLC and plays the video, but I'm trying to find a way to stop this popup from happening. I have been searching for days and can't find an answer. I'm using ie11 on win8.1. Any help would be greatly appreciated.

Also if I use Windows Media Player instead of VLC the message doesn't pop up, but I'd prefer VLC if I can get it to work.

Thank you for your time. Greg


Solution

  • You can use objShell.Run command with some vbscript to open the mp4 files when you click the links. Try the code below.

    <HTML>
        <head>
    
        <script language="VBScript"> 
        Dim oShell
        function openit(myFile)
            Set objShell = CreateObject("Wscript.Shell")
            objShell.Run myFile
        end function
        </script>
    
        </head>
        <body>
            <a href="#" onclick="runit 'file:///C:******\Video1.mp4'" language="vbscript">Video 1</a>
            <a href="#" onclick="runit 'file:///C:******\Video2.mp4'" language="vbscript">Video 2</a>
            <a href="#" onclick="runit 'file:///C:******\Video3.mp4'" language="vbscript">Video 3</a>
            <a href="#" onclick="runit 'file:///C:******\Video4.mp4'" language="vbscript">Video 4</a>
        </body>
    </html>