Question

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.

enter image description here

But when I manually run the command prompt as an administrator and write netsh wlan start hostednetwork it will execute the command.

enter image description here


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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top