I have an intranet project based on the PHP and xampp server on the Windows. That intranet project have database with table where I store scanned disc drive informations of files and folders. I using simple windows command dir "$directory_path" /Q /T:C
to get informations.
After that I use regex to match and parse that info to separate date, time, permission and dir name like on this example:
EXAMPLE REGEX FOR DIRECTORY PARSING
It's similar like this example: Get file owner in Windows using PHP
This working fine but sometimes file owner names are realy long and was stripped by command line. In that case I can't read full name and functionality is broken.
Now I searching for another solution.
My PHP have instaled also php_com_dotnet.dll
extension and I using COM()
class in some part of code.
My main question is:
-Can I use COM()
class to get real file informations and avoid shell commands for the file search and listings and how?
-Is there some another extension, shell command or something 3rd what I can use to get file/folder owners?
NOTE: I need this only for the reading and indexing in the database, don't need to change permissions or ownership.