0

On my wife's laptop I'm trying to stop it using Windows Update by switching on metered connection. But there doesn't appear to be that option. When I go to Settings - Network & Internet - Wi-Fi, there is no advanced settings to click on and find metered connection. Here is a screen shot on what the Wifi tab looks like with no option to go any further that I can see. Why doesn't it look like the the examples I've found on the Internet?
Screen_Shot_2016-11-10_at_11_59_06.png

3
Contributors
5
Replies
25
Views
11 Months
Discussion Span
Last Post by Reverend Jim
1

I was checking out my settings to lead you through the steps when I noticed that the Advanced link on my wi-fi settings was missing. This is where you would go to set/clear the metered option. Lacking this, there is a command line option. Open a command shell and type:

netsh wlan show profiles

On my laptop I see

Profiles on interface Wi-Fi:

Group policy profiles (read only)
---------------------------------
    <None>

User profiles
-------------
    All User Profile     : KenNet
    All User Profile     : mynet-camp
    All User Profile     : mynet
    All User Profile     : ROGERS7608

The profile I am interested in is mynet-camp. For further details type

netsh wlan show profile name="mynet-camp"

On my laptop I see

Profile mynet-camp on interface Wi-Fi:
=======================================================================

Applied: All User Profile

Profile information
-------------------
    Version                : 1
    Type                   : Wireless LAN
    Name                   : mynet-camp
    Control options        :
        Connection mode    : Connect automatically
        Network broadcast  : Connect only if this network is broadcasting
        AutoSwitch         : Do not switch to other networks
        MAC Randomization  : Disabled

Connectivity settings
---------------------
    Number of SSIDs        : 1
    SSID name              : "mynet-camp"
    Network type           : Infrastructure
    Radio type             : [ Any Radio Type ]
    Vendor extension          : Not present

Security settings
-----------------
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Authentication         : WPA2-Personal
    Cipher                 : Unknown
    Security key           : Present

Cost settings
-------------
    Cost                   : Fixed
    Congested              : No
    Approaching Data Limit : No
    Over Data Limit        : No
    Roaming                : No
    Cost Source            : User

The area of interest is Cost Settings. You can see that the first parameter is set to Fixed. That corresponds to a metered connection. You can set metered or unmetered by

netsh wlan set profileparameter name="mynet-camp" cost=Fixed
netsh wlan set profileparameter name="mynet-camp" cost=Unrrestricted

where Fixed = metered and Unrestricted = non-metered

Votes + Comments
By your command. *bewoop bewoop.
0

If you are concerned about inadvertantly borking something by using a command like netsh that you are unfamiliar with you might use the following script code that I wrote up. It executes the netsh command in a very restrictive fashion. You can use it in three ways:

  1. metered
  2. metered <profile>
  3. metered <profile> ON | OFF

The first form lists all wi-fi profiles. The second form (if you give it a profile name from the first form) will display the metered status of that profile. The third form will allow you to set the metered status on or off for a given profile. Copy the folllowing code and save in a file named metered.vbs. Run it from within a command shell. See the notes in the file header.

'
'   Name:
'
'       metered.vbs
'
'   Description:
'
'       Command line utility to set an internet connection to metered
'       or non-metered
'
'   Usage:
'
'       metered
'
'           Show existing profiles
'
'       metered <profile>
'
'           Show metered/non-metered status of <profile>
'
'       metered <profile> ON | OFF
'
'           Set metered status of <profile> to on or off
'
'   Notes:
'
'       The default engine for running scripts is wscript.exe. Before
'       running this script you should set the default engine to cscript.exe
'       (command line - wscript is windowed). Open a command shell as
'       Administrator and enter:
'
'           cscript //nologo //h:cscript //s
'
'       You will only have to do this once.
'
'   Audit:
'
'       2016-11-10  rj  original code
'

set wso = CreateObject("Wscript.Shell")
set arg = Wscript.Arguments

Select Case arg.Count

    Case 0  'no args - show all profile names

        profiles = Filter(ExecCmd("netsh wlan show profiles"),":")
        Wscript.Echo Join(profiles,vbcrlf)

    Case 1  'one arg - display current metered status for given profile

        profile = ExecCmd("netsh wlan show profile name=""" & arg(0) & """")
        status  = Filter(profile,"Cost                   :")

        Select Case True

            Case not CheckProfileExists(arg(0),profile)

            Case instr(status(0),"Fixed") > 0
                Wscript.Echo arg(0),"is set to metered"

            Case instr(status(0),"Unrestricted") > 0
                Wscript.Echo arg(0),"is set to non-metered"

        End Select

    Case 2  'two args - set metered connection on or off for given profile

        command = "netsh wlan set profileparameter name=""" & arg(0) & """ "

        Select Case Ucase(arg(1))

            Case "ON"
                result = ExecCmd(command & "cost=Fixed")
                CheckProfileExists arg(0),result

            Case "OFF"
                result = ExecCmd(command & "cost=Unrestricted")
                CheckProfileExists arg(0),result

            Case Else
                Wscript.Echo "state must be either ON or OFF"

        End Select

End Select

'Execute the given (DOS) command and return the output in a text array

Function ExecCmd ( cmd )

    'Execute the command

    dim exec: set exec = wso.Exec(cmd)
    dim res : res = ""

    'Read all result text from standard output

    do
        res = res & vbLf & exec.StdOut.ReadLine
    loop until exec.StdOut.AtEndOfStream

    'Return as a text array

    ExecCmd = Split(Mid(res,2),vbLf)

End Function

'Return True if the output text in <text> was such that the given
'profile was valid, False otherwise (print error message if not valid)

Function CheckProfileExists (profile,text)

    If Ubound(Filter(text,"is not found on the system")) = -1 Then
        CheckProfileExists = True
    Else
        CheckProfileExists = False
        Wscript.Echo "Profile",profile,"not found."
    End If

End Function
2

The problem is that on some systems the Advanced option has been removed from the GUI. Thus the only way to set/unset the metered option is via the command line.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.