public static void main( String args[] )
{
String cmd="cmd";
if(System.getProperty("os.name").equals("Windows 98")){
System.out.println("Your OS is Win98");
cmd="command";
}
try{Runtime.getRuntime().exec(cmd + " /c del c:\\a\\abcdefg.txt");}
catch(Exception e){System.out.println(" Error of Deleting File!");} }