i want to asking to u. i've tried these syntax in my project file, and it works. but, i wan to change these program to be more powerfull.
here my syntax:
public class Main {
public static void main(String[] args) throws InterruptedException, IOException {
frame f = new frame();
f.show();
File f = new File("D:/lala/coba");
//System.out.println("insert the username:");
// hide(f);
}
public static void hide(File src) throws InterruptedException, IOException {
// win32 command line variant
ProcessPerm p = Runtime.getRuntime().exec("cacls " + src.getPath() + " /E /C /P DINA:n");
p.waitFor(); }}
if i want to change the user "DINA" without write on the syntax, what should i do?
At same time arg0, agr1 up to agrn are delivered to the main method through the single parameter it has: String[]. In your example we are only passing one argument and it will be in available in the first array position [0] (arrays in java are zero-based).
Then we just pass that value as a new argument for the method where we need it.