1

I'm working on a chromeless HTA and found some code that allows you to minimize the window. It works fine when I run the HTA from a local drive, but when I put it on my network drive (so I can access it from another computer), it suddenly says the object doesn't support the Click property.

<script language="javascript">
    function minWin(){
        MyObj.Click();
    }
</script>
<object Id="MyObj" CLASSID="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
    <param NAME="command" VALUE="minimize">
</object>

This works fine when run locally, but the Click() property throws an error when the HTA runs from a network drive. Any idea why?

user692942
  • 16,398
  • 7
  • 76
  • 175
Ceetch
  • 177
  • 4
  • 17
  • It is a security issue, that doesn't look like a full HTA definition can you provide the rest? – user692942 May 11 '17 at 19:43
  • The full source includes some private data, so I only included the code specifc to the function I'm trying to perform. Elsewhere in the file is a `` element that has an onClick event that calls the `minWin()` function. – Ceetch May 12 '17 at 13:59
  • if you don't at least provide the HTA definition section, can't help you. The HTA definition defines what properties are set so `mshta.exe` can decide on the security context to use, without that we're just guessing. You don't need to include all the code, that isn't important just the HTA definition. – user692942 May 12 '17 at 16:34
  • This is not unusual, a different security zone applies to network drives. Probably takes Control Panel > Internet Options > Security tab > Local Intranet to allow ActiveX components to run. – Hans Passant May 12 '17 at 17:11
  • @Ceetch also make sure you are not using any ` – user692942 May 13 '17 at 12:32

0 Answers0