Turn On or Off File and Printer Sharing in Windows 10  

Page 4 of 5 FirstFirst ... 2345 LastLast

  1. Posts : 68,894
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #30

    Odd. That command should be setting the "File and Printer Sharing" rule in Windows Defender Firewall "Allowed apps" like below based on the specified network profile in the command.

    Turn On or Off File and Printer Sharing in Windows 10-windows_firewall_allowed_apps.jpg
      My Computers


  2. Posts : 4
    Windows 10, Server 2016
       #31

    Ok, I found the correct command:

    Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any
      My Computer


  3. Posts : 68,894
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #32

    Hmm, it should use "-Profile Any" by default when it isn't specified in the command.

    I've updated the tutorial to include that in the command to make it more specific.
      My Computers


  4. Posts : 83
    Windows 10 x64 22H2
       #33

    Hi, Brink
    Your Command of the tutorial couldn't work for me, too.
    Therefore, I found this command could work for me. I wanted to share with you.
    Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server
    "乙太網路 2" is the word such as "Ethernet 2" in Chinese Traditional.
    The aforementioned command used elevated PowerShell to finish the setting.
    Best Regards.
      My Computer


  5. Posts : 68,894
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #34

    shiwan0804 said:
    Hi, Brink
    Your Command of the tutorial couldn't work for me, too.
    Therefore, I found this command could work for me. I wanted to share with you.
    Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server
    "乙太網路 2" is the word such as "Ethernet 2" in Chinese Traditional.
    The aforementioned command used elevated PowerShell to finish the setting.
    Best Regards.
    Thank you shiwan0804, and welcome to Ten Forums.

    This is basically the same as doing option 4, but using PowerShell instead.

    I added this PowerShell method as option 5 to the tutorial so it may helps others.
      My Computers


  6. Posts : 83
    Windows 10 x64 22H2
       #35

    Hi, Brink
    I want to ask the option five about using command prompt to finish it automatically.
    Is it possible that default to open elevated PowerShell and then run the command codes automatically?
    Because I used elevated command prompt to run the command codes and then got a fail only.
    My command codes were as following.

    cd C:\Windows\System32\WindowsPowerShell\v1.0
    powershell
    Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_msclient
    Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server
    exit
    The failed picture was as following.
    Turn On or Off File and Printer Sharing in Windows 10-command-failed-run-automatically.jpg
      My Computer


  7. Posts : 68,894
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #36

    shiwan0804 said:
    Hi, Brink
    I want to ask the option five about using command prompt to finish it automatically.
    Is it possible that default to open elevated PowerShell and then run the command codes automatically?
    Because I used elevated command prompt to run the command codes and then got a fail only.
    My command codes were as following.

    cd C:\Windows\System32\WindowsPowerShell\v1.0
    powershell
    Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_msclient
    Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server
    exit
    Test this below in your .bat file to see how it runs for you. UAC will prompt for elevation.

    Code:
    @echo off
    powershell -windowstyle hidden -command "Start-Process cmd -ArgumentList '/s,/c,PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_msclient & PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server' -Verb runAs"
      My Computers


  8. Posts : 83
    Windows 10 x64 22H2
       #37

    Brink said:
    Test this below in your .bat file to see how it runs for you. UAC will prompt for elevation.

    Code:
    @echo off
    powershell -windowstyle hidden -command "Start-Process cmd -ArgumentList '/s,/c,PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_msclient & PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server' -Verb runAs"
    Hi, Brink
    I tried the command codes and then failed. Thanks for your help firstly.
    The message said that the argument may need to modify to find 2?
    Turn On or Off File and Printer Sharing in Windows 10-failed-again.jpg
      My Computer


  9. Posts : 68,894
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #38

    shiwan0804 said:
    Hi, Brink
    I tried the command codes and then failed. Thanks for your help firstly.
    The message said that the argument may need to modify to find 2?
    May be some language translation issue with the command.

    Ok. Let's try this:

    1) Create a .bat file with the commands below.

    Code:
    PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_msclient
    
    PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server

    2) Move the .bat file to where you want to keep it saved at.

    3) Create a shortcut of the .bat file.

    4) Use option 9 below to make the shortcut always run as administrator.

    Run as Administrator in Windows 10

    5) Move or pin the shortcut to where you want to use it at.
      My Computers


  10. Posts : 83
    Windows 10 x64 22H2
       #39

    Brink said:
    May be some language translation issue with the command.

    Ok. Let's try this:

    1) Create a .bat file with the commands below.

    Code:
    PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_msclient
    
    PowerShell Disable-NetAdapterBinding -Name "乙太網路 2" -ComponentID ms_server

    2) Move the .bat file to where you want to keep it saved at.

    3) Create a shortcut of the .bat file.

    4) Use option 9 below to make the shortcut always run as administrator.

    Run as Administrator in Windows 10

    5) Move or pin the shortcut to where you want to use it at.
    It still happened the same issue such as last command code.
    I changed the language code from UTF-8 to ANSI, but it still failed to find "Ethernet 2".
    Turn On or Off File and Printer Sharing in Windows 10-still-failed.jpg
      My Computer


 

Tutorial Categories

Turn On or Off File and Printer Sharing in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  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 20:51.
Find Us




Windows 10 Forums