Handle a dot to terminate the script.
Close DIR handles.
Add batch implementation and sample script.