none
Help me plz try to run vbs script on localhost RRS feed

  • Question

  • Help me plz

    I try to run vbs script on localhost i mean when user download the (HTML+the vbs) file he can run the file (vbs)

    is not working on chrome or any other browser.

    example: test.html

    <HTML>
    <HEAD>
    <script type="text/vbscript">
      sub test
        const runminimized = 7
        const dont_wait_for_end = false
        Set wshShell = CreateObject("WScript.Shell")
        WshShell.Run "C:\AppServ\www\exe\test.vbs",runminimized, dont_wait_for_end
      end sub
    </script>
    </HEAD>
    <BODY>
      these are the instructions
      <button onclick="vbscript:test" >Run the script</button>
    </BODY>
    </HTML>

    Any help plz.

    Thursday, April 30, 2015 8:17 PM

Answers

  • The answer is that you cannot do that because a browser cannot run code on the local computer.

    Imagine if this were possible. This should help explain why you cannot do this.

    However, you can rename the .html file to .hta. This will run the html file as a local application.


    -- Bill Stewart [Bill_Stewart]

    Thursday, April 30, 2015 8:29 PM
    Moderator

All replies

  • I try to run vbs script on localhost i mean when user download the (HTML+the vbs) file he can run the file (vbs)

    is not working on chrome or any other browser.

    example: test.html

    <HTML>
    <HEAD>
    <script type="text/vbscript">
      sub test
        const runminimized = 7
        const dont_wait_for_end = false
        Set wshShell = CreateObject("WScript.Shell")
        WshShell.Run "C:\AppServ\www\exe\test.vbs",runminimized, dont_wait_for_end
      end sub
    </script>
    </HEAD>
    <BODY>
      these are the instructions
      <button onclick="vbscript:test" >Run the script</button>
    </BODY>
    </HTML>

    Any help plz.

    Thursday, April 30, 2015 8:19 PM
  • The answer is that you cannot do that because a browser cannot run code on the local computer.

    Imagine if this were possible. This should help explain why you cannot do this.

    However, you can rename the .html file to .hta. This will run the html file as a local application.


    -- Bill Stewart [Bill_Stewart]

    Thursday, April 30, 2015 8:29 PM
    Moderator
  • yes i want run the ( html or/and php ) file on localhost and that html or/and php can run [exe//vbs] file 

    1 - runing the [ html or/and php ] file on the browser.

    2 - the [ html or/and php ] file excute the exe / vbs file on the localhost 

    like that 127.0.0.1/run/test.php run on the browser then execute the exe/vbs file

    Thursday, April 30, 2015 9:09 PM