Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

636 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