5

My particular issue involves the WScript object with VBScript in a HTA.

<script language="VBScript">
    Sub test()
       Set objShell = CreateObject("WScript.Shell") 
    End Sub
</script>

This works perfectly on my work computer(Windows 7 Enterprise) but not on my computer at home(Windows 8 home) and not on my mothers computer(Windows 7 home).

BUT WAIT! THERE'S MORE!

At first I thought maybe the libraries were not there so but I checked another program I wrote that uses JavaScript and it has no problem. Tested the javascript in my app and it runs fine.

<script language="JavaScript">
    function javaTest()
    {
        objShell = new ActiveXObject("WScript.Shell");
    }
</script>

This is the error I keep getting.

ERROR: Provider cannot be found. It may not be properly installed.

I keep coming across solutions about 64 vs. 32 bit and I try them and it doesn't work. It also doesn't explain why it works in JavaScript and not VBScript. I'm frustrated, searched high and low, and I really want a McDouble right about now. So, any info would be greatly appreciated, even if you have to tell me "It's hopeless. Rewrite the whole thing in JavaScript"

2
  • 1
    You can mix VBScript and JScript on a single page, so you should theoretically be able to call Set objShell = javaTest() in your VBScript code. It's a workaround, though, not a solution, but it's better than rewriting the whole thing. Commented Apr 13, 2013 at 6:57
  • Check the PATH (both USER and SYSTEM). You can do this by typing PATH from the command prompt, then check which apps might be running your script first. Commented Apr 16, 2013 at 1:48

1 Answer 1

2

You probably have different settings on launching ActiveX objects in browsers on this computers. To make it launch try to configure it in browsers:

  • Open on Tools
  • Select Internet Options...
  • Select Security tab.
  • Select Internet in Web content zone. (or zone in which your web page is)
  • Then, click on Custom Level...
  • Find ActiveX section on list (it is really long)
  • In ActiveX settings select Prompt or Enable
Sign up to request clarification or add additional context in comments.

5 Comments

Update: Works on my mother's computer (windows 7). Well I tried your suggestion Garath, and no go. Cheran, it's not that bad of an idea and greatly reduces my rewrite time. This copy of Windows 8 was installed within a week ago(OEM copy). Only things that have been installed are: Visual studio 2012 express, Dev C++, Net Bean ide7(with JRE), and a couple of other sdks. Besides that, music and photos from my backup. Is there maybe something I am missing?
Which IE you are launxhing metro or normal?
Normal. By normal I'm assuming it's the same as desktop mode.
Strange. It's working now. These were the steps I took. Enabled(or prompt). Reinstalled the MDAC. And have rebooted about 10 times. If only I could actually remember the last step I took. Thank you for at least pointing me in the right direction.
You don't need to thank you on stackoverflow. Just mark answer as correct or +1 for useful

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.