title: how to execute vbscript from website
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. it actually get computer info. hoping it will work on the users machine. any ideas will be appreciated. If or if anyone knows how to do it with jscript  </p>
  
  <p>Here is the code : </p>
  
  <pre><code>strComputer = "."
  
  Set objWMIService = GetObject("winmgmts:" _
      &amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2")
  
  Set colSettings = objWMIService.ExecQuery _
      ("Select * from Win32_OperatingSystem")
  
  For Each objOperatingSystem in colSettings 
      Wscript.Echo "OS Name: " &amp; objOperatingSystem.Caption
      Wscript.Echo "Version: " &amp; objOperatingSystem.Version  
      Wscript.Echo "Available Physical Memory: " &amp; _
          objOperatingSystem.FreePhysicalMemory
  Next
  
  Set colSettings = objWMIService.ExecQuery _
      ("Select * from Win32_ComputerSystem")
  For Each objComputer in colSettings 
          Wscript.Echo "Total Physical Memory: " &amp; _
          objComputer.TotalPhysicalMemory
  Next
  
  Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\CIMV2")
  
  Set colSettings= objWMIService.ExecQuery _
      ("SELECT * FROM Win32_DiskDrive")
  For Each objItem In colSettings
        WScript.Echo "Disk Size: " &amp; objItem.Size 
     Next
  
  Dim WSHShell 
  Dim objAdr 
  On error resume next 
  Set WSHShell = WScript.CreateObject("WScript.Shell") 
  test = wshshell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names") 
  If err.number &gt; 0 Then 
  msgbox "SQL Server not found" 
  else msgbox "SQL Server found" 
  end if 
  </code></pre>