Wrox Programmer Forums
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 7th, 2005, 10:10 AM
Registered User
 
Join Date: Nov 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default shared folder

Hi
how can i share an exiting folder with VBS , set the maximum number of connection to the maximun allowed, and define the access rights
for example if i have a folder called FOLDER and i want it to be shared: i want the adminstrators to have a total control on it, and the users can only read it, and another group can modify it and read it, and i want to set number of connection to the maximum...
is it possible ?
thanks
Reply With Quote
  #2 (permalink)  
Old December 21st, 2005, 02:05 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Here is some sample code that might get you started in enumerating these values.

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Share",,48)
For Each objItem in colItems
    Wscript.Echo "AccessMask: " & objItem.AccessMask
    Wscript.Echo "AllowMaximum: " & objItem.AllowMaximum
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "MaximumAllowed: " & objItem.MaximumAllowed
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Path: " & objItem.Path
    Wscript.Echo "Status: " & objItem.Status
    Wscript.Echo "Type: " & objItem.Type
Next

I am not sure if you can set administrative/user rights on a share without using ADSI. Is that what you are using?

HTH

mmcdonal
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!!! Trying to create shared folder. VB.NET PankajGarg10 General .NET 0 April 13th, 2007 01:34 AM
App_Code folder shared on only 1 folder? rpeters83 ASP.NET 2.0 Professional 1 September 1st, 2006 10:53 PM
Making a folder virtual folder on button click in CsharpHelp C# 0 October 26th, 2005 05:57 AM
How to set permissions on a shared folder adman Pro VB 6 1 February 19th, 2004 11:07 AM
Set permissions on a shared folder adman Beginning VB 6 2 February 12th, 2004 03:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.