Jump to content

Script to disable file sharing of the local C drive.


Recommended Posts

Guest Emllik
Posted

I was looking for a script that would disable the sharing of the c: drive on a local machine that could be loaded into the start up.

The problem is we have a group policy that enables the sharing of the c: drive on all machines. Only administrators can do this which is fine but we have a couple of groups of folks that have proprietary data on the drives that do not need to be seen by everybody. The big problem is that the company refuses to move them to a separate group or just disable the service altogether. Everything is done in house but they totally refuse to do anything about it. I do not think the people upstairs really care and I think the AD Group is just putting it off due to laziness. Moving people to new groups and changing the policy is out of the question due to "the needs of the business" but at the same time we can not have this sensitive data accessible by anybody with some admin rights.

 

I am unable to do this on my own so that is why I came here. I really have no experience in scripting and I need some help.

I am looking for a script that will simply disable the sharing of the C:\ drive on start up.

I don't even know if this is possible but it would be great if it was. I found one on the web this afternoon but I have not had time to test it and in all reality I have no idea what it is.

Thanks

 

******************************************************

@echo off

If {%1}=={} @echo Syntax: NoSFS ComputerName1 [ComputerName2 ... ComputerNamen]&goto :EOF

setlocal

:Next

if {%1}=={} endlocal&goto :EOF

set computer=%1

shift

set computer=%computer:"=%

set key="\\%computer%\HKLM\SYSTEM\CurrentControlSet\Control\Lsa"

if /i "%computername%" EQU "%computer%" set key="HKLM\SYSTEM\CurrentControlSet\Control\Lsa"

@echo reg add %key% /v forceguest /t REG_DWORD /d 00000000 /f

reg add %key% /v forceguest /t REG_DWORD /d 00000000 /f

@echo.

goto :Next

 

******************************************************

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...