Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 28th, 2003, 04:22 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old December 1st, 2003, 09:29 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
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();



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 03:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.