Get disk_space with credentials

Well, I'm trying to do to get information about disks on the local network. I saved the UNC paths in an XML file and scrolled it.

In PHP, I do:

$filename = 'C:/...../config/config.xml';
echo '<div class="container">';

if (file_exists($filename)) {
    $xml = simplexml_load_file($filename);

    foreach($xml->children() as $Path) {
        foreach($Path->children() as $Path1) {
           $disk = disk_total_space($Path1);
.
.

This works very well, but when I try to get disk information on another network, it fails. Therefore, when I first connect through UNC-Path in windows (with username and password), then it works, because now I have access. I can display network drives, but this is not a good solution for me, because there are a lot of drives.

Now my question is: is there a way to pass the username and password to UNC-Path?

+4
source share
1 answer

- :

( , UNC-) -.

0

Source: https://habr.com/ru/post/1606594/


All Articles