----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hi
I am using Apache Web Server .One of my servlets needs to execute a Batch
script(unix).The code for Invoking the batch script is as follows ie
try{
Runtime myRuntime = Runtime.getRuntime();
String sCommand,sPath;
sPath="/usr/apache-d/htdocs/WebPages/Servlets/Admin/";
sCommand = new String("sh " + sPath + "restart.bat");
int iResult;
iResult = myRuntime.exec(sCommand).waitFor();
}
catch(Exception e)
{
MyUtil.errorLog("Error in executing batch script");
}
where restart.bat is my shell script.
When i try the above code in a normal java problem without apache web server
it runs fine and executes the shell script.
Please tell how to call the batch script from a servlet invoked by the
apache web server.
regards
Hiren
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]