Solved

how to call windows exe with parameter from asp.net application

Posted on 2009-05-20
3
599 Views
Last Modified: 2013-11-26
how to call windows exe with parameter from asp.net application? Actually I have written code in button_load event. its running fine when i run from my computer and it passes parameters but when i published my web app on server and i tried from there , its not loading my exe. forget about parameter.
Please Send me reply asap.
Dim sInfo As New Diagnostics.ProcessStartInfo("//vsapps/cgs/ContractAutomation.exe") 'C:\\Documents and Settings\\hkacholi\\My Documents\\Visual Studio 2005\\Projects\\TestParamFromAsp\\TestParamFromAsp\\bin\\Debug\\TestParamFromAsp.exe")
 
        ' startInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Maximized
        Dim p As New Diagnostics.Process
        'Diagnostics.Process.Start(sInfo)
 
        sInfo.Arguments = "12345" 'Contract number
 
        'Diagnostics.Process.Start(sInfo)
 
        sInfo.RedirectStandardOutput = True
        sInfo.RedirectStandardInput = True
        sInfo.RedirectStandardError = True
        sInfo.CreateNoWindow = True
        sInfo.UseShellExecute = False
 
        p.StartInfo = sInfo
        p.Start()

Open in new window

0
Comment
Question by:hkacholia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
GuitarRich earned 125 total points
ID: 24433350
That code behine will be running on the server so it will try to run the program on the server not the client. To do it on the client you need to use client side scripting like javascript - which you can do with the following code got from here http://www.tutorial5.com/content/view/51/45/
<SCRIPT Language="JScript">
function runcmd() {
File="cmd.exe";
WSH=new ActiveXObject("WScript.Shell");
WSH.run(File);
}
</SCRIPT>

Open in new window

0
 

Author Comment

by:hkacholia
ID: 24435565
how to pass parameter with WSH.run(file)
i want to pass contract number from asp web application to windows vb exe so that it will come up with contract number n existing details.
0
 

Author Comment

by:hkacholia
ID: 24452295
It works thanks.
but i wanted to pass an argument also with opening exe so that i can pull up all the information about that id or number.
it works with system.diagnostics.process.arguments.
i wrote that in code behind , it works fine but when i write javascript it didnt pass parameter.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question