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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run vb script from web page. 1

Status
Not open for further replies.

Jouster

Programmer
Dec 4, 2000
82
US
I posted this on the HTML forum, but thought i would put it here also to see if I could get some answers...


What I would like to do is to be able to have the user click on a button and then I will run a script to send information to a barcode scanner connected to the user's PC (window.print won't work). The script would be a .vbs preferably.

This would be running on an intranet here at work.

If anyone has a better idea, I'm open at this point.
 
does this script need to be run the client?

WshShell.Run "vbscreipt.vbs
 
<<does this script need to be run the client?>>
I'm not sure, but i think it does need to.


<<WshShell.Run "vbscreipt.vbs">>
I tired this, but i get an error saying it can't create the active x object....
 
Set WshShell = CreateObject("Wscript.Shell")

this code wont work i dont think, the second part of it needs to be slightly different i think, unless you are running it client side, there have been a few posts on this sort of thing but i cant recall the syntax, perhaps you can find it with a search or one of my estemed forum members can help us out of a jam
 
Have a look at hta

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
After doing some more searching this is what i came up with:

This code goes in the head section:

<script language="vbscript">
Public Sub RunScript()
Set objWSH = CreateObject("WSCript.Shell")
strCMD = "c:\net.vbs"
objWSH.Run(strCMD)
Set objWSH = Nothing
End Sub
</script>


THis code goes in the Body section:

<FORM NAME="Form1">
<INPUT TYPE=BUTTON OnClick="RunScript" VALUE="Disable">
</FORM>

I had to change the security properties of the browser to allow this to work also.

Thanks,
-J
 
I had to change the security properties of the browser
Seems you haven't followed my advice ...
 
Sorry PHV, wasn't sure what hta was... A little more explanation may help. Someone told me to use FF on another forum. Didn't really know what that was either.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top