way to detect if cellular is on or not?


  1. Posts : 116
    W10
       #1

    way to detect if cellular is on or not?


    Hi,

    I'm looking for a way to detect (by script) if cellular is on or off.
    We have users where Cellular (or in Dutch, "Mobiel") is suddenly and unknowingly turned on.
    See the image for clarification.

    My question is , is there a way, WMI or registry, that i can use to detect this?

    way to detect if cellular is on or not?-zz.png

    EDIT: So i've figured out these are called "quick actions". You can fully disable them via a the registry :

    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkUxManager\Windows.Networking.UX. Internal.MBMediaManager

    But that just "gray's out" the option entirely. That's not my goal.
    Last edited by zztemp; 27 Feb 2020 at 06:27.
      My Computer


  2. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    I think the built-in command Netsh can get the info you want and you should then be able to use it in a batch file or other script to generate a warning.

    Notes
    1 Many Netsh explanations and 'command references' are out of date or apply only to Windows Server [and many of them do not make that clear to the reader]. You should rely only on what you can demonstrate in your own admin command prompts.
    2 Netsh will provide a lot of its Help info in a normal command prompt but that is misleading because many of its commands require admin permision. I suggest both getting the info and running all test & development in admin command prompts and then, when you have the final version try it in a normal command prompt to see if it works or not.
    3 I do not have cellular so I cannot do any more than guide you to the right section.

    Using Netsh
    A In a command prompt, enter
    Code:
    netsh /?
    to see the overall Help then enter
    Code:
    netsh mbn show
    to see the bit I think you need.

    B I think you will want to run this command to identify your profile name
    Code:
    netsh mbn show profiles
    and then use this within a
    Code:
    netsh mbn show profilestate
    command to get info about it.
    - It is safe to run both these commands as they are shown here.
    - The first one will get you information and, for all I know, it might be all that you need.
    - The second one will respond with details of its syntax just as if you had followed it with /? and will later give you information when you include a profile name in it.

    C If you post the responses from the command[s] you use when cellular is on as well as when it is off then, if you need me to, I can post back with code that will extract the relevant part of the return in order to set a variable that you would go on to use in any 'reporting' script you set up.
    C1 It is just easier to alter my variable-setting sample script for your needs than to explain it in advance - once you see it you'll be able to re-use the code for other pruposes because it is quite straightforward. You might already be familiar with such techniques anyway.
    C2 I can also help with your 'reporting' script later on.

    Denis
      My Computer


  3. Posts : 116
    W10
    Thread Starter
       #3

    Hi, thanks for your response!

    I tried the netsh-route, the problem is that this only works if the SIM is unlocked and thus, there is an actual connection to the cellular tower.

    However, in our case, the SIM is locked but the "Celullar \ Mobiel" option as shown in my image is switched on (blue).
    This causes some network issues now and then.

    So the goal is to figure out, whether or not that button is "blue" or turned on.
      My Computer


  4. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    If there is an answer then it is either
    1 Somewhere in netsh mbn, or
    2 In the Registry

    Try
    1 using NirSoft's RegFromApp as you turn those factors on & off to see if/how that is stored in the Registry, and/or
    2 using RegShot to compare Registry entries before & after changes.
    - regshot download - SourceForge.net
    - regshot - Discussion
    - How to Use Regshot To Monitor Your Registry - HTG

    Denis
      My Computer


  5. Posts : 116
    W10
    Thread Starter
       #5

    Try3 said:
    If there is an answer then it is either
    1 Somewhere in netsh mbn, or
    2 In the Registry

    Try
    1 using NirSoft's RegFromApp as you turn those factors on & off to see if/how that is stored in the Registry, and/or
    2 using RegShot to compare Registry entries before & after changes.
    - regshot download - SourceForge.net
    - regshot - Discussion
    - How to Use Regshot To Monitor Your Registry - HTG

    Denis

    Cool stuff didn't know those tools. I've tried doing this with the procmon by sysinternals but didn't quite find what i was looking for. I'll give these a go on monday, thanks a bunch!
      My Computer


  6. Posts : 116
    W10
    Thread Starter
       #6

    So i compared the registry and found some key with "radioOff". Sadly it's not what i was hoping for.
    I guess i'm gonna have to admit defeat :/
      My Computer


  7. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #7

    Did that key change its state when your Mobiel was turned on / off i.e. was it a marker of the thing you wanted to know about?

    Denis
      My Computer


  8. Posts : 264
    Windows 10
       #8

    What does this show?

    netsh interface show interface

    If it reads your mobile interface as enabled or disabled, there you go!
      My Computer


  9. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #9

    xaccell said:
    What does this show?

    netsh interface show interface

    If it reads your mobile interface as enabled or disabled, there you go!
    The OP has already answered that question.

    Denis
      My Computer


  10. Posts : 116
    W10
    Thread Starter
       #10

    I found the registry keys that turn on and of those quick actions.
    I'll post them when i am back at work.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:59.
Find Us




Windows 10 Forums