私はこれらの構文を試しましたが、なぜうまくいかなかったのですか?ウィンドウ内でファイルの変更権限をjava native(cacls)で使用する方法
本当にあなたの助言に喜んでいます。
ありがとうございます。悪い英語のために申し訳ありません。
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()
どうしましたか?何を手に入れましたか? – MByD
私は、これらの構文では、これらの構文のファイルアクセス権を記述パスとして変更できることを念頭に置いています。 –
私は何も得られません。 Windowsエクスプローラでファイル(images1.jpg)をチェックすると、ファイルのアクセス権が機能しません。 –