Sign in to follow this  
Followers 0
Morel

Array Limit ?

2 posts in this topic

Hello i am try To Move All Our Shares in One Server to other location the only way is

to change the Registry so i wrote a code the read the Keys and Delete Them and then

i will create them with my changes

* we have about 1000 Shares and i need to delete about 500 Keys

What is Wrong With That Script it tell me that i have Exsited the Array Limit ??? :o

#include<Array.Au3>
Dim $Array[1]

For $I = 1 to 1000
    $ReadKey = RegEnumVal("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares",$I)
    $ReadVal = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares",$ReadKey)
    If StringInStr($ReadVal,"E:\Users",0) > 0 Then
        _ArrayAdd($Array,$ReadKey)
    EndIf
Next
$Array[0] = UBound($Array)
For $X = 1 To $Array[0]
    RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares",$Array[$X])
Next

Please Help Me ?

Share this post


Link to post
Share on other sites



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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0