Hi
Can we delete the folder too when deleting the file inside it using Runtime.exec() function.I have the file name buy not the folder name.So when my code deletes that file inside the folder i want the folder to be deleted as well,as its empty.
Why are you using Runtime.exec to delete a file and folder ?
The File and Files classes have methods for doing exactly that and will keep your code OS independent.
There are also methods for getting the name of the parent directory of a file or directory.