Emnico in Swindon and its partners
in the UK and Europe provide:

» IT Support Services and Products
» Bespoke Software Development


Contact our Swindon office on:
+44 (0)1793 614 700
to discuss your IT needs.


CLOSE IT
Emnico Logo
Your Virtual Technology Team
Delivering Peak Performance
Category: Type: Order:
Search For:  
Home > Library > Give Full Access

Give Full Access

This script gives everyone read and write permission to a folder.
Added 283 days ago by Emnico
Download
Review
Back
66Views
This script has been successfully tested by Emnico and is verified to be working.

Source code

Dim strHomeFolder, strHome, strUser
Dim intRunError, objShell, objFSO

strHomeFolder = "C:\FOLDER"

Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strHomeFolder) Then
	intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
	& strHomeFolder & " /t /c /g everyone:F ", 2, True)
	
	If intRunError <> 0 Then
		Wscript.Echo "Error assigning permissions for user " _
		& strUser & " to home folder " & strHomeFolder
	End If
End If


| Privacy policy | Environmental policy | Site map |