I think the UDF is exiting early and not restoring the SetOption. Try putting a trailing hack on the path.
$FileArray = DirPlus('c:\program files\','/s')

The UDF can also include a filter so you need not check for .idf and it will return the FSO COM handle so you can access the prop directly without another UDF.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.