?
Solved

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

Posted on 2009-05-20
3
Medium Priority
?
602 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 375 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

777 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