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
