Hi, somehow I cannot get it work to run netsh.exe as a
standard user.
My goal:
switch between 2 NICs in my PC - 1 using a VPN connection, the other is connected directly (for gaming). I am currently switching using 2 batch files with the
runas /user:administrator
command where I have the issue that the script is executed sometimes with a delay of 20-30secs
My steps:
1) As Admin user
- I created a Win10 task "Switch_WAN_to_VPN" following the guide with the following parameters:
- general: use the following user account: standard user (not admin)
- action:
cmd.exe /c start "Switch_WAN_to_VPN" "%windir%\system32\netsh.exe" "interface set interface REGULAR enable"
- I tested the task and it works (for the test I put in the general tab the admin account under which the tasks should run)
2) As standard user
- I created a shortcut
schtasks /run /tn "Switch_WAN_to_VPN"
- The tasks seems to be executed, but the NICs are not changed.
In order to fix it, I performed the following steps:
(1) I changed the user account under which the tasks should be executed from "standard user" to "admin user".
Then of course I cannot execute the task anymore as standard user (error: access denied) and I need again to use the
runas /user:administrator
command which gives me the delay.
(2) I changed the command slightly adapting the ":
"%windir%\system32\netsh.exe" "interface set interface REGULAR enable"
"%windir%\system32\netsh.exe interface set interface REGULAR enable"
Any advice?