#21369 - 2002-05-08 07:18 PM
enumkey @error 259 with 2 keys left. ??
|
j95661
Getting the hang of it
Registered: 2001-02-27
Posts: 84
Loc: sacramento,ca usa
|
Im using the enumkey to find drives that have been manually mapped. for some reason,,, not consistantly @error is 259 when there are still subkeys left. I just rolled this into production ... aaahh. any help would be appreciated..
If @INWIN = 1 Dim $counter, $Outputfile, $Index, $KeyName, $RemotePath, $ConnectedAs, $DeleteDrive, $fsize $OutputFile="\\kxtv2\drives$\" + @USERID + ".kix" $Index = 0 Open(2,$OutputFile,5) While @ERROR = 0 $KeyName = EnumKey("HKEY_CURRENT_USER\Network\", $Index) If @ERROR = 0 $RemotePath=ReadValue("HKEY_CURRENT_USER\Network\$KeyName","RemotePath") $ConnectedAs=ReadValue("HKEY_CURRENT_USER\Network\$KeyName","UserName") WriteLine(2,"USE " + $KeyName + ": '" + $RemotePath + "'" + Chr(13) + Chr(10)) $DeleteDrive = DelTree("HKEY_CURRENT_USER\Network\" + $KeyName) $Index = $Index + 1 EndIf Loop Close(2) $fsize = GetFileSize($OutPutFile) If $fsize = 0 Del $OutputFile EndIf EndIf
_________________________
WonderBoy
Constantly learning everyday, how much I dont know :-)
|
|
Top
|
|
|
|
#21370 - 2002-05-08 08:33 PM
Re: enumkey @error 259 with 2 keys left. ??
|
j95661
Getting the hang of it
Registered: 2001-02-27
Posts: 84
Loc: sacramento,ca usa
|
well this wasnt as big of a newbie error as I usually have. I found I was deleting the key in my while loop, and that threw off my index.. no wonder why I was deleting every other key..
ya live and ya learn..
_________________________
WonderBoy
Constantly learning everyday, how much I dont know :-)
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 611 anonymous users online.
|
|
|