Tanya
Wed Feb 08 15:01:55 CST 2006
Thank you Stuartd
I have been figting with the netshare for the last couple of hours, this
works perfectly.
Tanya
"stuartd" <user@example.net> wrote in message
news:ul3Ff.7728$Fy4.1162@newsfe4-win.ntli.net...
> Tanya Legault wrote:
>> I am trying to add a share in my system automatically,
>>
>
> Hi Tanya
>
> You can do this quite easily with WMI:
>
> * VFP6 and earlier need to use CreateObject syntax
> oWMI = getobject("winmgmts:")
> oShare = oWMI.Get("Win32_Share")
> nResult = oShare.Create("c:\temp", "share_name", 0)
>
> if nresult = 0
> ? "Success"
> endif
>
> There are more parameters for maximum connections and security, see
>
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/create_method_in_class_win32_share.asp
>
> regards
>
> stuartd
>
http://weblogs.foxite.com/stuartdunkeld