Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: CMD scripts to toggle smb share?

15 Jan 2020   #1
peter7277

Windows 7 Ultimate x64
 
 
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 System SpecsSystem Spec
.
16 Jan 2020   #2
moilopol

Windows 7 x64bit
 
 

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 System SpecsSystem Spec
16 Jan 2020   #3
peter7277

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.
My System SpecsSystem Spec
.

16 Jan 2020   #4
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

Quote   Quote: Originally Posted by peter7277 View Post
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

Quote   Quote: Originally Posted by peter7277 View Post
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 System SpecsSystem Spec
17 Jan 2020   #5
peter7277

Windows 7 Ultimate x64
 
 

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 System SpecsSystem Spec
Reply

 CMD scripts to toggle smb share?




Thread Tools




Similar help and support threads
Thread Forum
InstallShield LE & SQL Scripts
I'm supposed to create an installer for a program for my TAFE course. The program needs a DB to work. I got the short straw and drew the junky InstallSheld LE. :sick: Other students got the even worse ClickOnce (it has failed to create an installer every time I've tried it). :mad: Only...
Software
IE9 prompts to run scripts or activex
Good morning, Im running Win7 64. IE9 patched up to date. I installed two programs that assist with World of Tanks data. I normally do not take a chance with something like these stand alone programs (Dokaninstall was one of them, the other I unstalled and dont have the download anymore). Since...
Browsers & Mail
Batch Scripts
I am trying to run/create a batch script for the users on my domain to install a program that will download and update flash and java. I have the .exe stored on the network share and currently have most of the script written. The part where i need help is to have to .exe run as one of our network...
General Discussion
message about scripts on bootup?
Hi this is probably not a windows 7 problem but has only arisen since I changed from Vista, when I switch on and log in , as soon as my desktop appears I get a message (attached) can't seem to get rid of it, maybe I'm missing something obvious here?:confused:
General Discussion


Our Sites

Site Links

About Us

Find 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 02:52.
Twitter Facebook