Re: How to get a network drive name

From: Date: Thu, 02 Feb 2006 15:01:11 +0000
Subject: Re: How to get a network drive name
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-229724@lists.php.net to get a copy of this message
----- Original Message ----- From: "Jim Moseby" <JMoseby@nrbindustries.com> To: "'Ibrahima TALL'" <ibrahima.tall@icdint.fr>; <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.
« previous php.general (#229724) next »