When you run a workflow, it executes any scripts using the Network Service account, which has little if any permissions.
By changing the appliction pool identity (or createing a new one) with an actual named user, all your scripts will run under that user context and permissions.
Rob