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 \
Try this
runtime.getruntime().exec("cmd /C echo YOUR_PASS | runas /user:Admin \"C:\Program Files\test.bat\"");