Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run .vbs from ASP Page 1

Status
Not open for further replies.

cwsstins

MIS
Aug 10, 2004
412
US
I've got an .asp page with an image on it. I want users to be able to click the image and run a .vbs file, without getting the "Open, Save, or Cancel" File Download prompt.

I've got a vbs sub:
Code:
<script language="text/vbscript">  
  Sub PwdReset()
    Set wshshell=createobject("wscript.shell")
    wshshell.run "PasswordReset.vbs"
    Set wshshell=Nothing
  End Sub
</script>

Then the image is like this:
<img src="\\server\directory\image.jpg" onClick="vbscript:pwdReset()">

When I click the image, nothing happens.

If I run:
Code:
    Set wshshell=createobject("wscript.shell")
    wshshell.run "PasswordReset.vbs"
    Set wshshell=Nothing

by itself in a stand-alone .vbs file, it works. What's the problem?

stinsman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top