How to run ms-settings:wifi command in Windows Custom Shell launcher V2

Lakshmanan Balasubramanian 121 Reputation points
2021-12-23T15:46:50.913+00:00

Hi, I am currently working with the Windows Custom Shell Launcher V2. I have my application which will be executed in the custom shell and it works completely fine as expected. Now, In my application, I have a button that will trigger a component in windows. To be precise, I am executing this command "ms-settings:network-wifi" which must open the Wi-Fi settings window from the settings. It works with the normal windows but throws an error called "ShellExecute 'ms-settings:network-wifi failed (error 5)". I don't understand why this error appears and I guess it might be blocked in the custom shell or somewhere. Please, help me out with this. Thanks in advance.!

160173-er.png

Windows for business | Windows for IoT
Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sean Liming 4,806 Reputation points Volunteer Moderator
    2021-12-26T23:03:17.86+00:00

    Following the Launch the Windows Settings API, there can be a failure if the Wi-Fi adapter is not present. I assume you have an adapter present.
    Next, error 5 implies access denied. Does the Windows account running the shell have administrator privileges?


  2. Seeya Xi-MSFT 16,676 Reputation points
    2021-12-27T06:07:51.197+00:00

    Hi @Lakshmanan Balasubramanian ,

    Once you get this message, it seems that you don't have the permissions to run this command.
    Could you open a command prompt as an administrator?
    https://learn.microsoft.com/en-us/windows/configuration/kiosk-shelllauncher#enable-shell-launcher-feature

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Limitless Technology 40,076 Reputation points
    2021-12-27T17:34:39.383+00:00

    There are endless possibility for this error and cannot be troubleshooted unless you post the commands that you have used in the Windows Custom Shell Launcher.

    Here are a few situations that might cause this issue in the code:

    -The application doesn’t have admin privileges
    -System File Corruption
    -Custom System sounds are crashing the app
    -Application conflict
    -Overprotective Local policy

    Hope this resolves your Query!!


    --If the reply is helpful, please Upvote and Accept it as an answer--


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.