dos command in java

Hi

I have used google to get an answer for this.

This is the command i have used to run some dos commands in java

Unfortunately it doesn't throws any exceptions but still the directory and the file news.txt is not created.

Process t=objrun.exec("command.com /c dir > c:/news.txt");

Process p=objrun.exec("command.com /c mkdir c:/Prabhath");

Please help me....am using windows xp OS.

[430 byte] By [prabhath_ma] at [2007-11-27 10:02:24]
# 1
You are executing dos commands, and dos commands are using \ as separator, and not /Kaj
kajbja at 2007-7-13 0:36:41 > top of Java-index,Java Essentials,Java Programming...
# 2
Read http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
masijade.a at 2007-7-13 0:36:41 > top of Java-index,Java Essentials,Java Programming...
# 3

Note that the java.util.File has the following methods that might do the job :public File[] listFiles()

public boolean mkdirs()

public boolean createNewFile()

TimTheEnchantora at 2007-7-13 0:36:41 > top of Java-index,Java Essentials,Java Programming...
# 4
It works..many thanks
prabhath_ma at 2007-7-13 0:36:41 > top of Java-index,Java Essentials,Java Programming...