Looking at what code there is posted...

In your function you have:
$group=0
...
ReadProfileString($FileLocation + "\shares.ini", $group, "drive" + $x)

The syntax is supposed to be:
ReadProfileString ("file name", "section", "key")

I cannot see where $group is valid as a section name.

Also, have to wonder why the data in the INI is wrapped in quotes but not seeing the ConnectShare() UDF, all I can do is wonder. [Confused]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.