the only command that i know to get the owner of a folder in a batch script is:
dir %foldername% /q
this has two problems:
it shows in a list all foldername's content, so i've to read only the first row (which contains < DIR > and ".") or you've to run
dir %parent_of_foldername% /q | findstr "%foldername%"
if the owner have a long name (exemple:TrustedInstaller) this will be trimmed
here is my c:\
13/03/2013 18.33 <DIR> NT SERVICE\TrustedInstaProgram Files
13/03/2013 18.33 <DIR> NT SERVICE\TrustedInstaProgram Files (x86)
Then how can i get the owner's name of a folder in a batch script?