This is the command:
netsh wlan start hostednetwork runas /noprofile /user:mymachine\\administrator
I used ranas
to prevent the administrator privilege, but it won't.
But when I manually run the command prompt as an administrator and write netsh wlan start hostednetwork
it will execute the command.
I am sending this command from Java program, I can't run the command prompt as an administrator then write this command, It should be in one line command that do all works.
Any solution?
I believe what you are looking for is:
runas /noprofile /user:mymachine\administrator "netsh wlan start hostednetwork"
you just got the order of your commands switched on accident.