Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
net share AccountingDept=D:\Departments\Accounting
net share AccountingDept=D:\Departments\Accounting /GRANT:domain\Accountants,FULL /GRANT:domain\Auditors,READ
[green]
'==========================================================================
'
' NAME: CreateShareWithPermissions.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL : [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' COPYRIGHT (C) 2009 All rights reserved
' DATE : 5/23/2009
'
' COMMENT: Creates a new share and assigns permissions.
'
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'==========================================================================
'Declare the arrays[/green]
Dim FullPermArray
Dim ReadPermArray
[green]
'Populate the data in the arrays[/green]
FullPermArray=Array([red]"domain\accounting","domain\acctmgr"[/red])
ReadPermArray=Array([red]"domain\auditors"[/red])
[green]
'Set our folder path and share name[/green]
strFolderPath = "[red]D:\DepartmentShares\Accounting"[/red]
strShareName = "[red]Accounting"[/red]
[green]
'Don't edit any further
'Create our Shell Object[/green]
Dim WshShell
Set WshShell = CreateObject("wscript.Shell")
On Error Resume Next
[green]
'Build our permissions string for full permissions[/green]
For Each User In FullPermArray[green]
'Comment out the next line if there are no Full Perm users[/green]
Perms = Perms & "/Grant:" & User & ",Full "
Next[green]
'Build our permissions string for read permissions[/green]
For Each User In ReadPermArray[green]
'Comment out the next line if there are no READ Perm users[/green]
Perms = Perms & "/Grant:" & User & ",Read "
Next[green]
On Error GoTo 0
'Execute the command[/green]
WshShell.Run ("CMD.EXE /C NET SHARE " & strShareName & "=" & strFolderPath & " " & Perms)