You simply put the same text you'd type out in the shell into a text file, save it and then make it into a script using:
protect +s
If you put this script into your S: directory (making sure it handles any required changes of directory itself internally) , you should just be able to type the name of the script and it'll run like any other command.