Turn off administrative share on Windows 7

8

3

I have removed the administrative shares, but the shares are re-enabled after rebooting. I have also tried the editing the registry as described in this Microsoft forum post, but it's also re-enabled after a reboot. Is there anyway to disable the shares so that they remain disabled after a rebooting?

Davidenko

Posted 2014-02-10T12:19:09.020

Reputation: 1 279

Answers

9

In Windows 7 administrative shares are less harmful than in previous versions of Windows, because they are hidden over the network and can in addition only be accessed remotely by network administrators. Microsoft specifically warns that disabling them may cause some programs to malfunction (but doesn't say which ones).

If you wish to disable them, the only way is to create a startup script, because these shares are always recreated during the boot.

An example script is :

NET SHARE C$ /delete
NET SHARE D$ /delete
NET SHARE admin$ /delete

Put these commands in a .bat file, create a shortcut to it on the desktop (or elsewhere), then drag the shortcut to Start > All Programs > Startup to execute automatically upon login.

Another way to do the same thing is to save the shortcut or batch file in %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\.

harrymc

Posted 2014-02-10T12:19:09.020

Reputation: 306 093

You probably want to add this to the "Task Scheduler" so that it does not depend upon a user login. – palswim – 2015-07-28T17:34:37.193

How can you say that administrative shares are unusable in Windows 7? Maybe in your particular setup, but I do have d$ and c$ on my PC accessible from my laptop. – Kitet – 2014-02-16T22:01:31.107

@Kitet: You are right - my phrasing was much too general. Corrected. – harrymc – 2014-02-17T06:41:18.610

6

Please read this first http://support.microsoft.com/kb/842715/en-us - here you can find an potential issue that could happened while administrative shares are off. Some Windows services depend on it.

You may experience a variety of issues when administrative shares are removed or are otherwise missing from your computer.If you use the net share command or MPSReports, the output may show that your computer is missing the IPC$, ADMIN$, or C$ share. If you re-create a missing share, it may be missing again after the next startup or logon. This issue may occur even if you set the AutoShareServer and AutoShareWks registry DWORD values to 1.

If the affected computer is a domain controller, you may receive error messages on client computers during network logon or during the times when they try to join the domain. Sometimes, you can log on with client computers that are running Microsoft Windows 2000 or Microsoft Windows XP, but you cannot log on with client computers that are running Microsoft Windows 95, Microsoft Windows 98, or Microsoft Windows Millennium Edition.

When you try to access or view the affected computer remotely by using a UNC path, a mapped drive, the net use command, the net view command, or by browsing the network in Network Neighborhood or My Network Places, you may receive an error message.

You may receive errors when you try to perform administrative tasks on a domain controller. For example, MMC snap-ins such as Active Directory Users and Computers or Active Directory Sites and Services may not start, and you may receive an error message.

If you are sure what you are doing just google for answer.

Filip Gjorgjevikj

Posted 2014-02-10T12:19:09.020

Reputation: 165

1Hello Filip. "Link only" answers are not useful for this site. If the link goes away, the answer goes with it. Please paraphrase the content into your answer. Feel free to leave the links as reference, but answers should stand on their own. – Paul – 2014-02-16T01:48:08.103

3

You can remove the administrative shares on a Windows box and prevent them from being created automatically by editing the following registry key and setting its value to 0:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\AutoShareServer

To apply this change, you must stop and restart the server service, which you can easily do by entering the following commands at the command prompt:

net stop server
net start server

However, Microsoft recommends that you don't remove administrative shares because it can break many different things. For a list of problems that can occur, have a look at the Microsoft article: Overview of problems that may occur when administrative shares are missing.

Ahmadian Jafar

Posted 2014-02-10T12:19:09.020

Reputation: 31

Please read the question again carefully. Your answer does not answer the original question. OP has already tried the registry setting at it didn't work him. – DavidPostill – 2016-07-14T09:29:47.763

1That's because the correct key name is AutoShareWks, not AutoShareServer (at least for me, on Windows 10). The rest is correct, just change the key name. It's incorrect on at least one Microsoft website. – Glenn Slayden – 2016-10-29T22:42:56.803

start > run >msconfig > disable "network sharing services", if you don't use a shared LAN. – mosh – 2017-12-02T04:32:24.350

This MS support article gives the impression that if either value (AutoShareServer or AutoShareWks) is set to 1 the admin shares will be created. This link suggests the reason for the differently named values is because the AutoShareServer is used on server OSes and AutoShareWks is found on non-server OSes.

– I say Reinstate Monica – 2018-07-17T20:11:38.750

0

I have created one batch file and run it during startup. And same can be run anytime after Windows boots. This way I don't have to stop manually all the time.

NET SHARE C$ /delete
NET SHARE D$ /delete
NET SHARE E$ /delete
NET SHARE admin$ /delete

Chirag

Posted 2014-02-10T12:19:09.020

Reputation: 1

2Welcome to Super User! This duplicates another answer and adds no new content. Please don't post an answer unless you actually have something new to contribute. – DavidPostill – 2016-11-30T11:28:09.667