Create a .groovy file
In a project, add a build "Execute system grooovy script"
Choose Groovy script file
Enter the path to the script using one of Hudson global property (referenced by $PROPERTY_NAME)
The path is not expanded at execution.
The $PROPERTY_NAME is correctly expanded, and can be expanded as an absolute path if it is one. This is what happens in "Execute Shell" build.