Determine the current scripts directory in a more reliable and cross pla...

...tform way