Easiest thing to do is open a command prompt on the prime client and do the following
cd C:\STAF
execute "STAFEnv.bat"
execute "C:\STAF\bin\STAFProc.exe"
This will show you the error.
When you created your automated task (for the prime client only) make sure it starts STAF at login.
To test functionality open a command prompt and type "STAF local ping ping", it should respond with pong.