Solved

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

Posted on 2009-05-20
3
601 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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