This content has been marked as final. Show 7 replies
Runtime.getRuntime().exec(�start command /c delIt's very complicate so pay close attention ...
Runtime.getRuntime().exec("start command /c del <put the path here>*.keep") ;
Sorry sometimes my bad attempts at humor leap out I really should know better. But this should do what you want.
Say the file path is:
C:\Documents and Settings\Christy\Desktop\haha.txt
How would i write it exactly? I've tried a few ways and had it wrong?
edit: actually the example is.
Runtime.getRuntime().exec(�cmd /c del *.keep�);
Message was edited by:
Why not use java.io.File's delete method? Runtime is just going to make your code platform-dependent...
It's not just about deleting a file, I would like to know how. Can you help?
I think you may be having troubles with spaces in the path. Surround it with quotes:
Runtime.getRuntime().exec(�cmd /c del \"C:\\Documents and Settings\\Christy\\Desktop\\haha.txt\"�);
If you're looking for lessons on how to use the Windows shell, this isn't really the best place to ask.
No, that didn't work. I can't find anything on the internet about it either. Ok, not to worry then, thanks for your help. : )