faqts : Computers : Programming : Languages : Asp : ASP/VBScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

62 of 81 people (77%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How do I call a VB.exe program from an ASP program?

Oct 10th, 2002 16:22
Randy H, Robin Paardekam, Nate James,


I assume you want to run an executable at the server-side. As you might 
know it's not possible to run exe's client-sided. Here's the code:
<%
Set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "%comspec% /c FILENAME.EXE"
%>
Good luck!
Robin Paardekam
http://www.paardekam.nl
Sorry Robin. There are ways to run applications on the client side with 
VBScript. 
Here's an example that I came up with using the DOS Shell. it only 
opens media player but the command line can be changed to open any 
program
<html>
<body>
<Script language=vbscript>
    Dim oShell
Set oShell = CreateObject ("WSCript.shell")
oShell.run  ("cmd /K CD C:\Program Files\Windows Media Player & 
wmplayer & exit"), 2
Set oShell = Nothing
</script>
</body>
</html>
Have Fun,
Randy



© 1999-2004 Synop Pty Ltd