Hi, I found the code below to create a share of the hard drive but when
I tried to apply it to share the DVD drive on the computer it failed.
Does any one have done this before? I think may intType should use
something else.
Please help.
Thanks
Greg
--------------------------------------
strComputer = "."
strPath = "t:\"
strName = "img"
intType = 0 ' share a disk drive resource
intMaxAllowed = 10
strDescr = "img on dvd"
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set objShare = objWMI.Get("Win32_Share")
intRC = objShare.Create(strPath, strName, intType, intMaxAllowed,
strDescr)
if intRC <> 0 then
WScript.Echo "Error creating share: " & intRC
else
WScript.Echo "Successfully created share"
end if