windows - Undeletable Folder in java -
I tried to create Undeletable folder using Java code. I use "cacls (folder name) / e / c / d% username% at the command prompt at the command prompt. Then I tried to implement it in my Java class (Eclipse IDE). It does not work. UndeletableFolder.java If there is any other way to do this, thanks in advance. Is the current working directory set in the root directory of your" hidden "directory? Do you call the command? You can call it import java.io.buffferedReader; Import java.io.file; Import java.io.FileInputStream; Import java.io.FileOutputStream; Import java.io.IOException; Import java.io.InputStream; Import java.io.InputStreamReader; Public class unseen folder (public static zero main (string algos []) {runtime RT = runtime.gettime (); String cmd = ("cacls hide / e / c / d% username%"); ProcessorBuilder P = New process builder (new string [] ("CMD.exe", "/ c", CMD}); Processor pro; try {pro = p.start (); InputStream = Pro .getInputStream (); InputStreamReader isr = New InputStreamReader (buffated reader); New buffated reader (ISR); string line; while ((line = br.readline)! = Null {} System.out.println (line);}} hold ( IOException e) {// TODO auto-generated cal block e.printStackTrace ();}}}
ProcessBuilder.directory (java.io.File) . / P> .
Comments
Post a Comment