CMD scripts to toggle smb share?

peter7277

New member
Member
Local time
4:29 AM
Messages
83
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

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
yes, i think this is what u want

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


Disable
Code:
[B][URL="https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Set-ItemProperty?view=powershell-5.1"]Set-ItemProperty[/URL][/B] -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 –Force
#
Code:
o= disable 

1= enable
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 x64bit
Browser
Chrome
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

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
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

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

Computer type
PC/Desktop
OS
Windows 7 x64, Vista x64, 8.1 smartphone
CPU
Intel E8400 65W 64-bit
Motherboard
Gigabyte EP45-UD3LR
Memory
DDR2 2 x 2GB, 1GB x 2
Graphics Card(s)
XFX Radeon HD5750
Sound Card
AMD High Definition Audio; Realtek High Definition Audio
Monitor(s) Displays
iiyama prolite X2377HDS
Screen Resolution
1920 x 1080
Hard Drives
500GB 7200 rpm Seagate ST3500413AS 16MB, 500GB 5400 rpm Toshiba MQ02ABF050H 32MB, 200GB 7200 rpm Seagate ST3200820AS 8MB, 2TB 7200 rpm Western Digital WD20EZRX 64MB
PSU
Enermax Liberty Modular
Case
Antec P193 Midi Tower
Keyboard
Mionix ZIBAL 60
Mouse
Razer USB 2.0 Diamondback Mouse or Huion Graphics Tablet
Browser
Internet Explorer, Lunascape, Firefox, Opera, Avast Safezone
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

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
Back
Top