running dos commands from a javabean
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ken_carey
Posted On:   Tuesday, September 3, 2002 02:39 AM

Hello, I am attempting to run dos commands from a javabean. The code below works in a standalone java program but not within a java beans. Any ideas as to why not? Thanks, Ken Carey. try{ String[] command; command[0] = "cmd.exe"; command[1] = "/c"; command[2] = "sample2.bat"; Process process = Runtime.getRuntime().exec(command); int done = process.waitFor(); process.destroy(); System.out.println("... Done."); }catch(Exception e){System.out.println(e);}    More>>

Hello,

I am attempting to run dos commands from a javabean. The code below works in a standalone java program but not within a java beans. Any ideas as to why not?


Thanks,



Ken Carey.



try{


String[] command;

command[0] = "cmd.exe";

command[1] = "/c";

command[2] = "sample2.bat";



Process process = Runtime.getRuntime().exec(command);



int done = process.waitFor();

process.destroy();

System.out.println("... Done.");



}catch(Exception e){System.out.println(e);}

   <<Less

Re: running dos commands from a javabean

Posted By:   Steven_Martin  
Posted On:   Tuesday, September 3, 2002 10:14 AM

That may be a permissions problem, what's the error you are getting running in the bean?
About | Sitemap | Contact