Need help in calling vbscript from html file

Discussion in 'Visual Basic ( VB )' started by user1, Feb 21, 2008.

  1. user1

    user1 New Member

    Joined:
    Feb 21, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I want to call a vbscript file from html. I am using the below code.

    I get the error 'ActiveX Component doesn't create an object 'WScript.Shell'

    Please help me with this
    HTML:
    <HTML>
    
    <HEAD><TITLE>Run CR Scripts</TITLE>
    
    <SCRIPT LANGUAGE="VBScript">
    
    
    Sub Button1_OnClick
    
    Dim WSHell
    Set WSHell = Server.CreateObject("Wscript.Shell")
    env = "PROD_57"
    
    WSHell.Run """\\k:\data\CR.vbs """ & env
    set WSHell = Nothing
    End Sub
    
    
    
    </SCRIPT>
    
    </HEAD>
    
    <BODY>
    
    <H3>Run CR Scripts</H3><HR>
    
    <FORM><INPUT NAME="Button1" TYPE="BUTTON" VALUE="Click Here"></FORM>
    
    </BODY>
    
    </HTML>
     
    Last edited by a moderator: Feb 22, 2008
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    It's probably because of Internet Explorer's sceurity settings, try lowering the security from Internet Options.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice