We run this code:
 
try {
   Runtime r = Runtime.getRuntime();
   Process p = r.exec(Cmd);
      }
   catch (java.io.IOException e)
   {
     System.out.println("In exception handler");
   }
 
By using Process you can wait until the process is finished if you want with a p.waitFor() or monitor the process output with p.getOutputStream() .  Hope this helps
-----Original Message-----
From: Ravisankar.N [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 9:15 AM
To: [EMAIL PROTECTED]
Subject: Can a Servelt Run a Batch File?

Hi Scoot,
 
Yes we can run batch file in servlet to.
 
Runtime t = getRuntime();
t.ecec("*.bat");   -- * is the batch file name.
 
Hope this helps.

Ravisankar
----- Original Message -----
Sent: Friday, August 09, 2002 6:50 PM
Subject: Can a Servelt Run a Batch File?

Can a servlet run a batch file on a Windows-based server?
 
TIA,

Scott

Reply via email to