Determine the current scripts directory in a more reliable and cross platform way