質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top