I *think* you are using DIR wrong.

Try replacing this
$path = DIR("C:\Documents and Settings\ctxtest3\Application Data\Amicas\config")

with
$path = "C:\Documents and Settings\ctxtest3\Application Data\Amicas\config"