Would be good if an expert on scratch dir/batch system scripts could take a look to confirm this is ok and doesn't break anything.