Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2003, 05:22 AM
Registered User
 
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default EXE Programs

Hi Guys!

How do you use a servlet to run a .exe program? Does anyone have a sample source code of such a program?


Thanks in advance!
Adrian

 
Old December 1st, 2003, 10:29 AM
Registered User
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In Java, to spawn an external program, you use the Runtime class.
Following is a sample:

String[] _args = { "myprog.exe", "arg1", "arg2" };
Process process = Runtime.getRuntime().exec( _args );
process.waitFor();
int _exitStatus = process.exitValue();








Similar Threads
Thread Thread Starter Forum Replies Last Post
Membership: aspnet_sql.exe -> aspnet_regsql.exe ricpue BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 9th, 2006 11:40 PM
problem creating .exe from MFC AppWizard(exe) c++ method Visual C++ 0 July 7th, 2006 03:28 AM
executing programs marjanm PHP How-To 0 August 27th, 2004 06:23 AM
PHP5 and php.exe php-cgi.exe php-win.exe freddo Beginning PHP 1 August 16th, 2004 09:28 AM
Prob calling .exe programs on Win XP. iisaphpache Pro PHP 0 May 31st, 2004 06:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.