title: how to execute vbscript using php
body: <p>i have a VBScript file. When its on the computer it works fine. I want to put it on a php site for it to be executed by a button click. but i have not been successful.i have a VBScript file. When its on the computer it works fine. I want to put it on a php site for it to be executed by a button click. but i have not been successful.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>Const ForReading = 1
  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.OpenTextFile("C:\AppServ\www\abcd\testFile.txt", ForReading)
  TheFile =   f.ReadAll
  
  myArray = Split(theFile,vbcrlf)
  
  for i = 0 to Ubound(MyArray)
  Next
  
  txt=Space(1)
  
  Set myShell = CreateObject("WScript.Shell")
      myShell.run "cmd"
      WScript.Sleep 100
  
      myShell.SendKeys"telnet 192.168.1.1"
      myShell.SendKeys("{Enter}")
      WScript.Sleep 1500
  
      myShell.SendKeys"myname"
      myShell.SendKeys("{Enter}")
      WScript.Sleep 1500
  
  
      myShell.SendKeys"mypassword"
      myShell.SendKeys("{Enter}")
      WScript.Sleep 1500
  
      myShell.SendKeys"sudo -i"
      myShell.SendKeys("{Enter}")
      WScript.Sleep 1000
  
      myShell.SendKeys"su - zimbra"
      myShell.SendKeys("{Enter}")
      WScript.Sleep 1000  
  
      myShell.SendKeys"zmprov ma " &amp; myArray(0) &amp; " zimbraAccountStatus locked"
      myShell.SendKeys("{Enter}")
      WScript.Sleep 1000
  </code></pre>
  
  <p>Thanks in advance.</p>