----- Original Message ----- From: "Jim Moseby" <[EMAIL PROTECTED]>
To: "'Ibrahima TALL'" <[EMAIL PROTECTED]>; <php-general@lists.php.net>
Sent: Thursday, February 02, 2006 3:41 PM
Subject: RE: [PHP] How to get a network drive name



i have already tryed this command barry, in fact the name of
the volume is
different from the name of a network drive. A volume concerns
a partition i
think
For exemple, you can define many drives, let say COMMON1(X:),
COMMON2(Y:) in
the DISK(C:).
In this situation, the volume name is DISK for the three drives and
different from COMMON1 and COMMON2.
I have tried many other dos commands but with no succes
TALL Ibrahima



You can do this:

$net_use=`NET USE`;//notice the backticks here!
$lines=explode("\n",$net_use);

The NET USE command gives many infos about the network drives by the name of the drive is not given.
See the Net Use output in the joined file of this message

tat         Local     Distant                   R,seau
-------------------------------------------------------------------------------
OK           X:        \\Icd-dsk-it-dv\Public    R,seau Microsoft Windows
D,connect,e  Y:        \\Icd-dsk-gm-dv\Public    R,seau Microsoft Windows
D,connect,e  Z:        \\Icd-dsk-wa-dv\Public    R,seau Microsoft Windows
D,connect,e            \\Icd-dsk-lc-dv\MP3       R,seau Microsoft Windows
D,connect,e            \\Icd-dsk-wa-dv\Public    R,seau Microsoft Windows
La commande s'est termin,e correctement.



This will give you an array containing the output, line by line, of the NET USE command. Use foreach() to cycle through the $lines array and parse out
the driver letters and names.

JM


Les nouvelles connexions seront m‚moris‚es.


tat         Local     Distant                   R‚seau

-------------------------------------------------------------------------------
OK           X:        \\Icd-dsk-it-dv\Public    R‚seau Microsoft Windows
D‚connect‚e  Y:        \\Icd-dsk-gm-dv\Public    R‚seau Microsoft Windows
D‚connect‚e  Z:        \\Icd-dsk-wa-dv\Public    R‚seau Microsoft Windows
D‚connect‚e            \\Icd-dsk-lc-dv\MP3       R‚seau Microsoft Windows
D‚connect‚e            \\Icd-dsk-wa-dv\Public    R‚seau Microsoft Windows
La commande s'est termin‚e correctement.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to