Author Topic: Addons To Delete Net Shares  (Read 12515 times)

0 Members and 1 Guest are viewing this topic.

Offline Netted

  • Newbie
  • *
  • Join Date: Mar 2014
  • Posts: 11
  • Karma: 0
    • View Profile
Addons To Delete Net Shares
« on: March 21, 2014, 04:32:50 am »
I found these commands then came across Advanced Tweaker
I am running Windows 7 Home Premium 64bit

Please advise with respect to deleting Net Shares.
I am aware of the do's and don't explanations throughout the internet
but I'm interested to know how rather than not know then I have a choice and means to do so.
Any help would be appreciated.

The below command prompt, command lines,  all work for me.

NET SHARE C$ /DELETE
NET SHARE D$ /DELETE
NET SHARE ADMIN$ /DELETE
NET SHARE IPC$ /DELETE
NET SHARE DFS$ /DELETE
NET SHARE COMCFG$ /DELETE

Then I came across Advanced Tweaker........  :smiley:
Running the  Advance Tweakers appropriate addons I am still left with  IPC$
The tweak to set DWORD 1 or 0 does change the registry, but does not disable / delete IPC$
as it still shows in the Computer / Manage / Shared Folders / Shares


Using NET SHARE IPC$ /DELETE at a prompt, deletes IPC$ until next reboot then IPC$ reappears.

I'd like to understand how to create a batch file / script and seek help to understand the correct
construction and syntax of such a file(s).

Would it be possible to execute all command simultaneously in a batch file
How would such a batch file be written for all of the below be written?

NET SHARE C$ /DELETE
NET SHARE D$ /DELETE
NET SHARE ADMIN$ /DELETE
NET SHARE IPC$ /DELETE
NET SHARE DFS$ /DELETE
NET SHARE COMCFG$ /DELETE


Any help and advise to get me started creating batch files / scripts would be very much appreciated.
What's a the difference between a batch file and script and when you'd use one in preference to the other?

Thank in advance.

 :smiley:







« Last Edit: March 21, 2014, 05:46:02 pm by Netted »

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Addons To Delete Net Shares
« Reply #1 on: March 21, 2014, 08:21:42 am »
Yes they can all be ran from a bat file, the add on creator with the program lets you do that :-)

The problem is that Windows is set to recreate those admin shares at every boot. So you just need to change 2 regkeys in the system and Windows will not make them any more.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters
AutoShareWks should be set to 0
and also do AutoShareServer to 0.

The AutoShareServer is normally for 2008 but I found it best to just put both :-)

Otherwise if those keys are not set and you run the cmd script to remove the shares they will just be recreated at the next boot.

Shane

Offline Netted

  • Newbie
  • *
  • Join Date: Mar 2014
  • Posts: 11
  • Karma: 0
    • View Profile
Re: Addons To Delete Net Shares
« Reply #2 on: March 21, 2014, 05:41:42 pm »
Shane

Thanks for the reply.
I'm still having no success permanently removing IPC$
See Attached Image.

I am really keen to understand this as I've spend much time trying to figure it out.
Can you tell me the difference between a script and a bat file?
When do you choose to use one rather than the other?

I looked at creating tweaks but didn't really understand the create process.
Once I've seen how something I've been trying to figure out is done
would be a great help to me.

Could you create the file to show what it looks like?

Create Batch File to Delete Net Shares and Visa Versa
Anonymous IPC$ Share Access
Administrative Shares.tweak
NET SHARE C$ /DELETE
NET SHARE D$ /DELETE
NET SHARE ADMIN$ /DELETE
NET SHARE IPC$ /DELETE
NET SHARE DFS$ /DELETE
NET SHARE COMCFG$ /DELETE

Thanks for your patience.

Please Advise

:smiley:



« Last Edit: March 21, 2014, 05:47:23 pm by Netted »

Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Addons To Delete Net Shares
« Reply #3 on: March 21, 2014, 08:06:31 pm »
You can actually few any of the tweak add on files in notepad :-)

I always make sure to make things where users can work with them. The tweak files are simple. You put in the vbscript, bat file commands or reg file settings and it simply outputs them and runs them. So you can look at any of the other tweaks with note pad to get an idea.

The add on creator can help as well.

As for why the IPC isnt being removed I dont know, you can see that registry setting got Windows to get rid of the others, but for some reason that other one is still showing up. And I checked on systems that I have that reg key on and they all are the same, only IPC is there. I have a feeling it is a bug in Windows.

Here made a quick tweak file like you asked :-)

Shane

Offline Netted

  • Newbie
  • *
  • Join Date: Mar 2014
  • Posts: 11
  • Karma: 0
    • View Profile
Re: Addons To Delete Net Shares
« Reply #4 on: March 22, 2014, 08:15:54 pm »
Shane

Thank you

For the reply and tweak.

I see what you mean, I changed the .tweak extension to .txt and can open in notepad.
I'll have a look at a few and see how I get on.

 :smiley:



Offline Shane

  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9281
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
Re: Addons To Delete Net Shares
« Reply #5 on: March 24, 2014, 12:15:15 pm »
Happy to help :-)

Shane