Jump to content

File and printer sharing for Microsoft networks


 Share

Recommended Posts

You could just use PowerShell to enable/disiable (check/uncheck) File and Printer Sharing for Microsoft Networks

#RequireAdmin

_FilePrintSharing("Ethernet", True)

Func _FilePrintSharing($_sAdapterName = "Ethernet", $_bEnable = True)
    Switch $_bEnable
        Case False
            ;~ Disable File and Printer Sharing for Microsoft Networks
            RunWait('PowerShell -Command "& {Disable-NetAdapterBinding -Name ' & "'" & $_sAdapterName & "' -DisplayName 'File and Printer Sharing for Microsoft Networks'" & '}"', "", @SW_HIDE)
        Case True
            ;~ Enable  File and Printer Sharing for Microsoft Networks
            RunWait('PowerShell -Command "& {Enable-NetAdapterBinding -Name ' & "'" & $_sAdapterName & "' -DisplayName 'File and Printer Sharing for Microsoft Networks'" & '}"', "", @SW_HIDE)
    EndSwitch
EndFunc

 

Link to comment
Share on other sites

You can use something like to enable/disable File and Printer Sharing for Microsoft Networks for all network adapters.

#RequireAdmin

_FilePrintSharing()

Func _FilePrintSharing($_bEnable = True)
    Switch $_bEnable
        Case False
            ;~ Disable File and Printer Sharing for Microsoft Networks
            RunWait('PowerShell -Command "& {Get-NetAdapter | Disable-NetAdapterBinding -DisplayName ' & "'File and Printer Sharing for Microsoft Networks'" & '}"', "", @SW_HIDE)
        Case True
            ;~ Enable  File and Printer Sharing for Microsoft Networks
            RunWait('PowerShell -Command "& {Get-NetAdapter | Enable-NetAdapterBinding -DisplayName ' & "'File and Printer Sharing for Microsoft Networks'" & '}"', "", @SW_HIDE)
    EndSwitch
EndFunc

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...