Code:

CreateShare(@wksta, "test$", "c:\drivers")

Function CreateShare($Server, $ShareName, $SharePath, optional $Domain)
dim $unc, $uncpath, $FService, $fileshare

if not $domain $domain = @domain endif

$unc = join(Split($SharePath,":"),"$$")
$uncpath = "\\"+$server+"\"+$unc
if not exist($uncpath)
makepath($uncpath)
endif

$FService = GetObject ("WinNT://"+$Domain+"/"+$Server+"/LanmanServer,FileService")
$FileShare = $FService.Create ("FileShare", $ShareName)
$FileShare.Path = $SharePath
$FileShare.MaxUserCount = -1 ; -1 allows unlimited connections. Any other positive number
$FileShare.SetInfo
EndFunction



seems to work just fine


Edited by Radimus (2005-10-03 11:09 PM)
_________________________
How to ask questions the smart way <-----------> Before you ask