Generate script
Avoid hardcoded directory