G Guest Nov 3, 2006 #1 Hi Does anyone have a vbscript to provide a list of folders and the permissions? Thanks
P Pegasus \(MVP\) Nov 3, 2006 #2 Maycon said: Hi Does anyone have a vbscript to provide a list of folders and the permissions? Thanks Click to expand... Try this batch file: Line1 @echo off Line2 Line3 set source=d:\My Shares Line4 set target=c:\%Permissions%.txt Line5 Line6 echo Compiling a directory listing Line7 dir /b /ad /s "%source%" > c:\dir.txt Line8 Line9 echo %date% at %time:~0,5% > %target% Line10 echo List of access rights >> %target% Line11 echo ==================== >> %target% Line12 for /F "tokens=*" %%* in (c:\dir.txt) do ( Line13 echo Processing %%* Line14 cacls "%%*" >> %target% Line15 ) Line17 del c:\dir.txt Line18 notepad %target%
Maycon said: Hi Does anyone have a vbscript to provide a list of folders and the permissions? Thanks Click to expand... Try this batch file: Line1 @echo off Line2 Line3 set source=d:\My Shares Line4 set target=c:\%Permissions%.txt Line5 Line6 echo Compiling a directory listing Line7 dir /b /ad /s "%source%" > c:\dir.txt Line8 Line9 echo %date% at %time:~0,5% > %target% Line10 echo List of access rights >> %target% Line11 echo ==================== >> %target% Line12 for /F "tokens=*" %%* in (c:\dir.txt) do ( Line13 echo Processing %%* Line14 cacls "%%*" >> %target% Line15 ) Line17 del c:\dir.txt Line18 notepad %target%
G Guest Nov 5, 2006 #3 Works very well. Thanks Pegasus (MVP) said: Try this batch file: Line1 @echo off Line2 Line3 set source=d:\My Shares Line4 set target=c:\%Permissions%.txt Line5 Line6 echo Compiling a directory listing Line7 dir /b /ad /s "%source%" > c:\dir.txt Line8 Line9 echo %date% at %time:~0,5% > %target% Line10 echo List of access rights >> %target% Line11 echo ==================== >> %target% Line12 for /F "tokens=*" %%* in (c:\dir.txt) do ( Line13 echo Processing %%* Line14 cacls "%%*" >> %target% Line15 ) Line17 del c:\dir.txt Line18 notepad %target% Click to expand...
Works very well. Thanks Pegasus (MVP) said: Try this batch file: Line1 @echo off Line2 Line3 set source=d:\My Shares Line4 set target=c:\%Permissions%.txt Line5 Line6 echo Compiling a directory listing Line7 dir /b /ad /s "%source%" > c:\dir.txt Line8 Line9 echo %date% at %time:~0,5% > %target% Line10 echo List of access rights >> %target% Line11 echo ==================== >> %target% Line12 for /F "tokens=*" %%* in (c:\dir.txt) do ( Line13 echo Processing %%* Line14 cacls "%%*" >> %target% Line15 ) Line17 del c:\dir.txt Line18 notepad %target% Click to expand...