CMD scripts to toggle smb share?


  1. Posts : 83
    Windows 7 Ultimate x64
       #1

    CMD scripts to toggle smb share?


    I want to keep smb share disabled when i don't need it and enable it only when i need it. Is there a way to create .bat scripts to toggle smb share?
      My Computer


  2. Posts : 14
    Windows 7 x64bit
       #2

    yes, i think this is what u want

    - have you seen Google?
    Enable or Disable SMB1 File Sharing Protocol in Windows | Tutorials


    Disable
    Code:
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 –Force
    #
    Code:
    o= disable 
    
    1= enable
      My Computer


  3. Posts : 83
    Windows 7 Ultimate x64
    Thread Starter
       #3

    This is not cmd command but powershell command, and it doesn't work. I am still able to login to my pc from my smb client on my android tablet.
      My Computer


  4. Posts : 2,798
    Windows 7 x64, Vista x64, 8.1 smartphone
       #4

    peter7277 said:
    This is not cmd command but powershell command, and it doesn't work. I am still able to login to my pc from my smb client on my android tablet.
    You need to re-start the computer for the prescribed changes to take effect.
    References:
    Enable or Disable SMB1 in Windows 7 using PowerShell | Ten Forums

    peter7277 said:
    I want to keep smb share disabled when i don't need it and enable it only when i need it. Is there a way to create .bat scripts to toggle smb share?
    From cmd, you can use net share to manage shared resources. But, this command only allows the user to create or delete a share. i.e., there is no provision to enable or disable.
    References:
    Net share | Microsoft Docs
      My Computer


  5. Posts : 83
    Windows 7 Ultimate x64
    Thread Starter
       #5

    I restarted my pc but i am still able to connect to my pc from my android smb client which means that smb share is still not disabled.
      My Computer


 

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

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