Check the write permission of any folder
Visual Basic
2
Posts
2
Posters
0
Views
1
Watching
-
hi all, how can i check whether any folder contains the permission for write ? Please suggest.
-
hi all, how can i check whether any folder contains the permission for write ? Please suggest.
Try this code. This code set the permission. may be this Helps you.
Function SetPermissions()
Dim strHomeFolder, strHome, strUser
Dim intRunError, objShell, objFSOstrHomeFolder = "C:\\Test" objShell = CreateObject("Wscript.Shell") 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 End Function
Thanks Khatri Mitesh
~Khatri Mitesh khatrimitesh@hotmail.com Bikaner (Rajasthan) INDIA