私はこれらの構文を試しましたが、なぜうまくいかなかったのですか?
あなたのアドバイスを本当に嬉しく思います。
前にありがとう。下手な英語でごめんなさい。
package priviledge;
import java.io.File;
import java.io.IOException;
/**
*
* @author DINA
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws InterruptedException, IOException {
File f = new File("C:/lala/images1.jpg");
permission(f);
}
public static void permission(File src) throws InterruptedException, IOException {
// win32 command line variant
Process p = Runtime.getRuntime().exec("cacls 000 " + src.getPath());
p.waitFor(); // p.waitFor()