How to get n script check a folder permission and sharing?
Moderator: DosItHelp
How to get n script check a folder permission and sharing?
Anyone got a script that woul go through a specfic path and check if a specify folder has sharing enable or not and also check permission?
Re: How to get n script check a folder permission and sharin
You can use the NET SHARE Command, it will be faster as it has all shared folders and files, also it contain each file/folder location in your PC.
I don't know about the permissions but this batch should give you a list of all shared resources along with there names.
If you want to check specific directory add IF command to compare the location you want so it display it if it exist.
I don't know about the permissions but this batch should give you a list of all shared resources along with there names.
Code: Select all
@Echo Off
For /F "skip=5 tokens=1* delims= " %%A in ('NET SHARE') Do (
Echo.
IF NOT "%%B" == "command completed successfully." (
Echo Shared Resources : %%B
Echo Share Name : %%A
)
)
pause
If you want to check specific directory add IF command to compare the location you want so it display it if it exist.
Re: How to get n script check a folder permission and sharin
Hi,
To check sharing enable or disable you can use NET Share command.
and to check the write permission, following will work
copy /Y NUL "%YourFolder%\.writable" > NUL 2>&1 && set WRITEOK=1
IF DEFINED WRITEOK (Echo ---- we have write access ----) else (Echo ---- we don't ----)
To check sharing enable or disable you can use NET Share command.
and to check the write permission, following will work
copy /Y NUL "%YourFolder%\.writable" > NUL 2>&1 && set WRITEOK=1
IF DEFINED WRITEOK (Echo ---- we have write access ----) else (Echo ---- we don't ----)