Making it NoVarsInStrings compliant is as easy as not putting vars in strings, hence the option "NoVarsInStrings". A string is in its siplest form, anything in quotes. So, for example:

if not exist("$uncpath")
should be:
if not exist($uncpath)

$path=makepath("$uncpath")
should be:
$path=makepath($uncpath)

$FService = GetObject ("WinNT://$Domain/$Server/LanmanServer,FileService")
should be:
$FService = GetObject ("WinNT://"+$Domain+"/"+$Server+"/LanmanServer,FileService")

While you're at it, the same holds true for macros:

$domain ="@domain"
should be:
$domain = @domain
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.