Const FILE_SHARE = 0
Const MAXIMUM_CONNECTIONS = TRUE
strComputer = "NetName"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objNewShare = objWMIService.Get("Win32_Share")
errReturn = objNewShare.Create ("c:\WINDOWS", "admin$", FILE_SHARE, MAXIMUM_CONNECTIONS, "Remote Admin")
Wscript.Echo errReturn
|