makeinstall Posted September 2, 2010 Share Posted September 2, 2010 (edited) Sorry about the ambiguous title but I will try to explain what I am doing. I need to read a users drive mappings (the server path & letter its mapped to) and then do a check to find a particular drive and respond back with the mapped letter. For instance: $var = DriveGetDrive( "all" ) If NOT @error Then For $i = 1 to $var[0] ConsoleWrite($var[$i]& " " & DriveMapGet ($var[$i]) & @CRLF) Next EndIf This will display all the drives with the paths mapped. What I need to do is run a check after to see which drive is the users personal network folder. I have tried to read up on multi arrays but cannot quite grasp how to dump the data into the multidimensional array (it would only require 2 columns)so it would look like this: drive | mapping | c: d: i: \\LON5\IT$ k: \\LON6\LUC m: \\LON5\MIS$ r: \\LON5\DEVELOP$ s: \\LON5\ISD$ u: \\LON5\gbxxxx$ w: \\LON5\NETAPPS Once its in the array, I would need to check which letter was mapped to the users ID (@username). In the above example: gbxxx$ = U. Any and all help is appreciated! Thanks Chris Edited September 2, 2010 by makeinstall Link to comment Share on other sites More sharing options...
Bert Posted September 2, 2010 Share Posted September 2, 2010 How are the personal network folders set now? IS it a Novell environment? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
makeinstall Posted September 2, 2010 Author Share Posted September 2, 2010 How are the personal network folders set now? IS it a Novell environment?Er..... not quite sure. Know a quick way I can check considering that I do not have server/domain admin? Link to comment Share on other sites More sharing options...
makeinstall Posted September 3, 2010 Author Share Posted September 3, 2010 I would hazard a guess that it is not a Novell environment. Anyone else have any suggestions on how to dump the mappings and corresponding drive letter into a multi array? Link to comment Share on other sites More sharing options...
Varian Posted September 3, 2010 Share Posted September 3, 2010 Here is one way#include <array.au3> $Var = DriveGetDrive("all") If Not @error Then Local $2DArray[$Var[0] + 1][2] ;$2DArray[0][0] = $var[0] uncomment and comment out line 14 if you want Drive Count For $i = 1 To $Var[0] $2DArray[$i][0] = $Var[$i] If DriveMapGet($Var[$i]) Then $2DArray[$i][1] = DriveMapGet($Var[$i]) Else $2DArray[$i][1] = DriveGetLabel($Var[$i]) EndIf Next _ArrayDelete($2DArray, 0) ;comment out and uncomment line 5 if you want Drive Count _ArrayDisplay($2DArray) EndIf Link to comment Share on other sites More sharing options...
makeinstall Posted September 6, 2010 Author Share Posted September 6, 2010 Thanks for the reply and help. I've been working through that code to try and understand the whole 2D array so that I can create & manipulate myself in future. A bizarre thing is happening now in that I'm writing some code to search the array but the auto complete in SCiTE doesn't seem to be aware of Array UDF. It sees _ArrayDelete & _ArrayDisplay but none of the others, especially _ArraySearch (See attached screencap). I've tried reinstalling SCiTE but it doesn't resolve it. Weirdness! Link to comment Share on other sites More sharing options...
Varian Posted September 6, 2010 Share Posted September 6, 2010 Same thing here. I use TextPad with syntax highlighting though. I only use Scite when I need to debug, although I have similar functionality in TextPad with an Au3check button. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now