Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now