Page 1 of 1 1
Topic Options
#21369 - 2002-05-08 07:18 PM enumkey @error 259 with 2 keys left. ??
j95661 Offline
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 Offline
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
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 611 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.047 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org