Mapping network drives is good but how do you share a local drive/folder? 
Author Message
 Mapping network drives is good but how do you share a local drive/folder?

I see lots of "WSHNetwork.MapNetworkDrive()" in scripting questions but how
does one go about sharing a local drive through WSH without using the
faithful "net share" command?
Just curious.
Ken Chapin


Sun, 31 Jul 2005 22:35:09 GMT  
 Mapping network drives is good but how do you share a local drive/folder?
Hi,
here is a script using adsi:

ShareName = "testshare"

Set myserver = GetObject
("WinNT://'mydomain'/'myserver'/lanmanserver")  

Set myshare = myserver.Create("Fileshare", ShareName)

myshare.Path = "c:\winnt\temp"
myshare.MaxUserCount = 10            
myshare.SetInfo
Set myServer= Nothing
Set myshare = Nothing

hope it helps;

Quote:
>-----Original Message-----
>I see lots of "WSHNetwork.MapNetworkDrive()" in scripting
questions but how
>does one go about sharing a local drive through WSH
without using the
>faithful "net share" command?
>Just curious.
>Ken Chapin

>.



Mon, 01 Aug 2005 01:24:52 GMT  
 Mapping network drives is good but how do you share a local drive/folder?

Quote:
> ShareName = "testshare"

> Set myserver = GetObject
> ("WinNT://'mydomain'/'myserver'/lanmanserver")

> Set myshare = myserver.Create("Fileshare", ShareName)

> myshare.Path = "c:\winnt\temp"
> myshare.MaxUserCount = 10
> myshare.SetInfo
> Set myServer= Nothing
> Set myshare = Nothing

Can someone explain to me why you would type in all of the above when a one
line "Net Use" does the same job?


Mon, 01 Aug 2005 04:33:38 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. get drive size from network network mapped drives

2. Create/Remove drive map to network share

3. Mapping a network drive directly to a subfolder of a share

4. Create a share on Local Drive

5. Map all shared drives

6. Network Connections / Shared Drives

7. Network / Shared Drive Access

8. Converting a network share spec into a path with drive letter

9. Network Drive mapping?

10. mapping a network drive

11. map network drive & getFile

12. Mapping a network drive

 

 
Powered by phpBB® Forum Software