How to execute dos command in Java?

I want to know hoe to execute dos command such as "dir" in java.i dont sure Runtime.exec() can help me or not!Please help me and tell me where can find tutorial about this thing! thx~
[220 byte] By [andyfai] at [2007-9-26 10:57:05]
# 1

Why don't you just try ... it will do. But for dir you should use something platform independent as:

File dir = new File(<directory path>);

String[] files = null;

if(dir.isDirectory()) {

files = dir.list();

}

thpreusser at 2007-7-1 23:43:00 > top of Java-index,Desktop,Runtime Environment...