Discussion:
Script to diable the C:$ share
(too old to reply)
nosborne
2009-05-21 17:58:26 UTC
Permalink
Hi,
I need to create a script that I can use in a GPO to disable thw c:$
share

I need to add a new key in the path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
set\Services\LanmanServer\Parameters

New DWORD Value called AutoShareWks with the value 0

Any Help will be gratfully appreciated.

Neal O
--
nosborne
------------------------------------------------------------------------
nosborne's Profile: http://forums.techarena.in/members/100141.htm
View this thread: http://forums.techarena.in/server-scripting/1184145.htm

http://forums.techarena.in
SubnetJO
2009-05-21 22:13:10 UTC
Permalink
This setting disable the "c$" or... ALL the administrative shares?
Be aware of this.

However, the script below does what you ask on the local machine.

======== START SCRIPT ==============
Const HKEY_LOCAL_MACHINE = &H80000002
Set
oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

KeyPath="SYSTEM\CurrentControlSet\Services\LanManServer\Parameters"
DwordName="AutoShareWks"
DwordValue=0

oReg.SetDWordValue HKEY_LOCAL_MACHINE,KeyPath,DwordName,DwordValue

======== END SCRIPT ==============
Post by nosborne
Hi,
I need to create a script that I can use in a GPO to disable thw c:$
share
I need to add a new key in the path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
set\Services\LanmanServer\Parameters
New DWORD Value called AutoShareWks with the value 0
Any Help will be gratfully appreciated.
Neal O
--
nosborne
------------------------------------------------------------------------
nosborne's Profile: http://forums.techarena.in/members/100141.htm
View this thread: http://forums.techarena.in/server-scripting/1184145.htm
http://forums.techarena.in
Michael Bednarek
2009-05-22 08:39:17 UTC
Permalink
On Thu, 21 May 2009 23:28:26 +0530, nosborne wrote in
Post by nosborne
Hi,
I need to create a script that I can use in a GPO to disable thw c:$
share
I need to add a new key in the path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControl
set\Services\LanmanServer\Parameters
New DWORD Value called AutoShareWks with the value 0
Any Help will be gratfully appreciated.
Neal O
Did you look at the documentation for reg.exe? Try:
reg add /?
--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
Loading...