I have to run a batch files from a java program which need administrative privilege. I am using the below command
runtime.getruntime().exec(\"runas /user:Admin \
You can't pipe a password into runas, as it requests the password from the terminal, not from stdin. There's no equivalent of "sudo -s".