Advertisement

03.04.2004 at 09:00PM PST, ID: 20907891
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Run executable from C# .Net
Tags: run, executable
This is an intranet application, so all execute permissions are granted.  I need to run a 3rd party application from a page on the site that I'm developing.  I'd like to be able to run either locally on the client or on the server.  I've seen solutions for ASP (WScript) and VB.Net (Shell), but how do you do this in C#?

Thanks
Question Stats
Zone: Programming
Question Asked By: todd_pravata
Solution Provided By: ClydeBalneaves
Participating Experts: 4
Solution Grade: A
Views: 244
Translate:
03.04.2004 at 09:25PM PST, ID: 10520264

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2004 at 09:25PM PST, ID: 10520265

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2004 at 09:53PM PST, ID: 10520353

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.04.2004 at 09:58PM PST, ID: 10520362

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.09.2004 at 02:24AM PST, ID: 10548940

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.09.2004 at 06:03AM PST, ID: 10550152

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.09.2004 at 06:11AM PST, ID: 10550214

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.09.2004 at 06:26AM PST, ID: 10550418

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.09.2004 at 07:51AM PST, ID: 10551287

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.10.2004 at 06:26AM PST, ID: 10560861

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.10.2004 at 06:31AM PST, ID: 10560899

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.10.2004 at 06:35AM PST, ID: 10560929

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.10.2004 at 06:54AM PST, ID: 10561112

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.02.2004 at 02:05AM PST, ID: 10739468

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.19.2004 at 11:46AM PDT, ID: 10862378

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.04.2004 at 09:25PM PST, ID: 10520264
I decided to try doing this using VB's Shell.   So why does this code not open the calculator?  I verified the path to the exe by running this from a command line.  Would also like to know the answer to the C# solution.  Will create another question for this an award points if someone has a solution.

<%@ Page Language="VB" Debug="True" %>
<script runat="server">

Public Sub Page_Load(Source As Object, E As EventArgs)
  Dim ProcID As Integer
  ProcID = Shell("C:\Windows\system32\calc.exe", AppWinStyle.NormalFocus, true, 30)
End Sub    

</script>

<html>
<head>
    <title>Run Script Test</title>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
 
03.04.2004 at 09:25PM PST, ID: 10520265
I decided to try doing this using VB's Shell.   So why does this code not open the calculator?  I verified the path to the exe by running this from a command line.  Would also like to know the answer to the C# solution.  Will create another question for this an award points if someone has a solution.

<%@ Page Language="VB" Debug="True" %>
<script runat="server">

Public Sub Page_Load(Source As Object, E As EventArgs)
  Dim ProcID As Integer
  ProcID = Shell("C:\Windows\system32\calc.exe", AppWinStyle.NormalFocus, true, 30)
End Sub    

</script>

<html>
<head>
    <title>Run Script Test</title>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
 
03.04.2004 at 09:53PM PST, ID: 10520353

Rank: Wizard

System.Diagnostics.Process.Start("C:\Windows\system32\calc.exe");
 
03.04.2004 at 09:58PM PST, ID: 10520362

Rank: Wizard

err..
use:
System.Diagnostics.Process.Start(@"C:\Windows\system32\calc.exe");
 
03.09.2004 at 02:24AM PST, ID: 10548940
Also, for more control you can use :

using System.Diagnostics;

//Create process
Process meProc = new Process();
meProc.StartInfo.FileName = @"C:\Windows\system32\calc.exe";  
//meProc.StartInfo.Arguments = "";

//Some other useful options if you want to capture the output to process in your app, good for command line apps
//meProc.StartInfo.UseShellExecute = false;
//meProc.StartInfo.CreateNoWindow = true;
//meProc.StartInfo.RedirectStandardError = true;
//meProc.StartInfo.RedirectStandardOutput = true;

meProc.Start();

//Capture output/errors
//string stderr = meProc.StandardError.ReadToEnd();
//string stdout = meProc.StandardOutput.ReadToEnd();

//Can use this to halt your code till the 3rd party app finishes
//meProc.WaitForExit();
 
03.09.2004 at 06:03AM PST, ID: 10550152
Where will this run?  Where the IIS server is hosted or on the client's machine?  Thanks.
 
03.09.2004 at 06:11AM PST, ID: 10550214
ASP(ASP or ASP.NET) is all server side, so any code will be run on the server only.  If you want it run on the client, you'll need the ASP to generatae vb/jscript (but this will have permission/security problems) or an activeX control.

Think you'll have trouble getting applications to run on a persons computer through the web browser, since its obviously a huge security problem.

 
03.09.2004 at 06:26AM PST, ID: 10550418
This code uses JS to run an application on a client side (windows).

<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
    var shell = new ActiveXObject("Shell.Application");

    var command = "C:\\windows\\Notepad.exe";
    shell.ShellExecute(command, "",   "", "open", "1");
</SCRIPT>

If you write that out into the HTML, it will open up notepad when the user views the page.
Accepted Solution
 
03.09.2004 at 07:51AM PST, ID: 10551287
Very cool.  I will test this later this evening (in the middle of preparing for a meeting) and award points tonight if it all works.

REALLY appreciate the help Clyde.
 
03.10.2004 at 06:26AM PST, ID: 10560861
Here's the entire contents of my .htm file.  When I open this file in the browser, nothing happens.  I have also tried the file extensions .asp and .aspx.  I've double checked the IIS settings on the application.  Execute and write permissions are allowed.  What else should I check?  What could be wrong?  Thanks.

<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
    var shell = new ActiveXObject("Shell.Application");

    var command = "C:\\windows\\Notepad.exe";
    shell.ShellExecute(command, "",   "", "open", "1");
</SCRIPT>

<html>
<head>
    <title>Run Script Test</title>
</head>
<body>
</body>
</html>
 
03.10.2004 at 06:31AM PST, ID: 10560899
FYI - I'm not trying to sabotage anyone's machine.

This is for an intranet application that I'm writing for a client - they archive boxes in a warehouse.  There is a 3rd party application that they use to upload files from a scanning device.  Those files then need to be imported into the DB behind the application that I'm writing.  I just want to be able to start that application from (say) a button click versus making the user go outside the application to bring it up.
 
03.10.2004 at 06:35AM PST, ID: 10560929
I presume your windows is actually installed in c:\windows, not c:\winnt? Sorry if thats a bit simple :)

Also, put the <script> tags inside the Head or Body of the HTML, not right at the top.
 
03.10.2004 at 06:54AM PST, ID: 10561112
OK, my browser was preventing the execution.  I relaxed the security on the intranet site and now it works.   Really appreciate your help.
 
04.02.2004 at 02:05AM PST, ID: 10739468
You do realise that you will need to change the security settings for every browser on your network viewing your Intranet?

 
04.19.2004 at 11:46AM PDT, ID: 10862378

Rank: Guru

> "...change the security settings for every browser on your network..."

This can be accomplished through a Windows 2000 group policy easily enough.
 
 
20071212-EE-VQP-20