Script to disable default share

'Disable_Default_Share.vbs'

'Script to Disable: Autoshare
'Author: Wijuk Thaitaworn (Thailand)
'Date: 02/06/09
'Version: 1.0

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "SYSTEM\CurrentControlSet\Services\lanmanserver\parameters"
strValueName = "AutoShareWks"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

strKeyPath = "SYSTEM\CurrentControlSet\Control\Lsa"
strValueName = "restrictanonymous"
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

strValueName = "restrictanonymoussam"
dwValue = 1
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue



'Techtoy'



.

ความคิดเห็น

บทความที่ได้รับความนิยม