I finally was able to solve this one.
Problem : We have an in-house VB application that takes information from our existing dialer and displays the relevant information from sql server. Vicidial can only open URL and I want a way to open my existing vb exe.
Solution:
Requirement -
1. Agent PC with IIS installed(Yes, you will need to configure IIS on each agent pc)
2. VB exe on local agent pc.
3. And the Classic ASP code(see below)
Copy this piece of code in a test file and change the extension to ".asp". Save this file to say C:\Inetpub\wwwroot\OpenExeAsp folder. Make this folder as Virtual Folder (Check this link on howto:
http://support.microsoft.com/kb/172138) . Name this virtual directory same as the folder name.
Now open IE and enter something like this:
http://localhost/OpenExeAsp/sample.asp (where sample.asp is the name of file where you saved the code)
This code fetches 5 parameters from the querystring, calls the exe and passes the parameter as an argument and closes the webpage. So please feel free to modify this according to you requirement.
pm me if anyone needs any help with this code.
- Code: Select all
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<%
Dim sMainQry
%>
<script language="VBScript">
Sub Scan()
Dim theform
set theform = document.forms("frmOne")
Set objShell = CreateObject("Wscript.Shell")
objshell.Exec "C:\Program Files\AgentExe\" & theform.AgentExe.Value & " ~" & theform.AgentID.Value & " ~TEST~" & theform.OrgID.Value & "~" & theform.RecordingFileName.Value & "~" & theform.ServerName.Value & "~" & theform.DBName.Value & "~"
'objshell.Exec "C:\" & theform.AgentExe.Value & " ~TEST~" & theform.OrgID.Value & "~" & theform.RecordingFileName.Value & "~" & theform.ServerName.Value & "~" & theform.DBName.Value & "~"
theform.submit()
End Sub
</script>
</HEAD>
<BODY onload="javascript:window.open('', '_self', '');">
<%
sMainQry = ""
%>
<form id="frmOne" onsubmit="javascript:window.close();">
<input type="hidden" name="AgentExe" value="<%=Request.Querystring("AgentExe")%>">
<input type="hidden" name="ServerName" value="<%=Request.Querystring("ServerName")%>">
<input type="hidden" name="DBName" value="<%=Request.Querystring("DBName")%>">
<input type="hidden" name="OrgID" value="<%=Request.Querystring("OrgID")%>">
<input type="hidden" name="AgentID" value="<%=Request.Querystring("AgentID")%>">
<input type="hidden" name="DialedPhone" value="<%=Request.Querystring("DialedPhone")%>">
<input type="hidden" name="RecordingFileName" value="<%=Request.Querystring("RecordingFileName")%>">
<button onclick="Scan" id=button1 name=button1 type=submit>Open AGENT EXE</button>
<% Response.Write(sMainQry) %>
</form>
</BODY>
</HTML>