I am trying to share a folder from within java using the following windows command: net share shareName=C:\folderName /grant:everyone,FULL
This command needs to be run as admin. Running it in the default cmd window gives a permissions error, but running it in cmd as admin works.
I am aware that you can run a command from within java using Runtime.getRuntime().exec("commandHere");
. However, this does not execute it as admin. I've looked around, but everything either pertains to running a file as admin, or opening cmd as admin, neither of which I want to do. I just want to execute that one command.