Vbscript to check shared folder security permission

Great for for getting all Windows related scripts.

Vbscript to check shared folder security permission

Postby Praveen » Wed Jul 15, 2009 11:36 am

Vbscript to check shared folder security permission;

This Script reads the input from a text file and check the security permission using the cacls.exe.
You can get list of shared folder from the computer management and shares. right click that folders and export to text file. Open the file in excel with tab seperated value. Now you have the list, then select the Column and paste it to the input of the text file.

Script

Code: Select all
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\folderlist.txt", 1) 'input text file
Do until objFile.AtEndOfStream
StrFolder = objFile.ReadLine
Set objShell = CreateObject("Wscript.Shell")
objShell.Run("%COMSPEC% /c cacls "& strFolder & ">>a.txt") 'important line (output will be in a.txt file
WScript.Sleep(3000) 'sleep the vbscript untile the command write the output to the text file
loop
User avatar
Praveen
Site Admin
 
Posts: 84
Joined: Sat Apr 25, 2009 2:21 pm

Return to Windows Scripting/WMI/VBScript

Who is online

Users browsing this forum: No registered users and 0 guests

cron