Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Execute System Commands

Fri Oct 24, 2008 9:45 pm

I want to Execute System Commands like dos commands within my program in jave
like ShellExecute function in C++



Re: Execute System Commands

Fri Oct 24, 2008 9:48 pm

Every Java application has a single instance of class
java.lang.Runtime that allows the application to interface with
the environment in which the application is running. The current
runtime can be obtained from the getRuntime method. An application
cannot create its own instance of this class. For executing
windows apps use

Runtime.getRuntime().exec( "cmd.exe /c start
NOTEPAD.EXE"); //open notepad

Post a reply
  Related Posts  to : Execute System Commands
 execute if else simultaneously     -  
 @NamedNativeQuery:SQLGrammarException could not execute quer     -  
 calculating time required to execute function     -  
 FTP commands     -  
 SQL AND OR in WHERE query Commands     -  
 DELETE Commands     -  
 jar files commands     -  
 Graphics commands list in C++     -  
 Write to system log     -  
 System.currentTimeMillis as Id     -