Two things wrong with this line:
$path = '\\server\folder\logdir

First off, it should be share, not folder and second, there is no closing quote.

$path = '\\server\share\logdir'
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.