Your problem is probably the $ inside of the path, which is a special character in Kix. Simply put the following at the top of your script to tell kix to ignore all $'s that are in strings...

$nul = SetOption("NoVarsInStrings", "On")

OR...You can also use double $$ to escape the $ character. So your path would become...

$path = '\\server\share$$\folder'

Either way should solve your issue.