Using the Corrected version of SubInAcl, I have scripted Own.bat
to return the owner of the file or folder you specify.
The syntax for using own.bat is:
call own FileOrFolder OwnerVariable
Where:
FileOrFolder is the path to the file or folder whose owner you want to determine. OwnerVariable is a call directed environment variable that will contain the owner.Own.bat contains:
@echo off if \{%2\}\{\} @echo Syntax: Own FileOrFolder OwnerVariable&goto :EOF if not exist %1 @echo Syntax: Own FileOrFolder %1 NOT found.&goto :EOF setlocal set owner=NONE set work="%TEMP%\WORK_%RANDOM%.TMP" SubInAcl /outputlog=%work% /noverbose /nostatistic /file %1 for /f "Tokens=1* Delims
" %%a in ('type %work%^|FIND "/owner"') do ( set owner=%%b ) endlocal&set %2=%owner%
0 comments
Hide comments