Page 2 of 2 <12
Topic Options
#148887 - 2005-10-03 11:08 PM Re: Creating Share on Remote Computer
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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

Top
#148888 - 2005-10-04 12:28 AM Re: Creating Share on Remote Computer
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: CA
You sort of did it.

Quote:

this is based on the UDF from KiXscripts.com



Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 584 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.053 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org