All mapped drives are listed in: HKEY_CURRENT_USER\Network.
Enumerating the keys below HKEY_CURRENT_USER\Network and writing this to some file could be done at logon.
code:
$Index = 0
:Loop1
$drives = EnumKey("HKEY_CURRENT_USER\Network", $Index)
If @ERROR = 0
ReDirectOutput ("c:\drives.log", 0) ; 0 to append to file. 1 to overwrite
? "Drive found: $drives"
$Index = $Index + 1
Goto Loop1
EndIf
Doing this remote is also possible.
code:
$Index = 0
:Loop1
$drives = EnumKey("\\workstationname\HKEY_CURRENT_USER\Network", $Index)
If @ERROR = 0
ReDirectOutput ("c:\drives.log", 0) ; 0 to append to file. 1 to overwrite
? "Drive found: $drives"
$Index = $Index + 1
Goto Loop1
EndIf
Both quoted from the manual and altered a little.
@error will be 0 until all keys are enumerated. Script will stop when error is different then 0.
[ 03. September 2003, 21:44: Message edited by: R2D2 ]
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.