It's not quite clear for me where do you want to do what but I think it's not possible in this way. Your error-message comes probably through the parser which detects invalid code/syntax, like the missing function return-value or that you put the function within the script and not within the macro-editor.
Beside this you couldn't call an ActiveX statement like "CreateObject" within the script-run because the for this required features/libraries aren't available in the script else only if the datamodel is built and an UI for the application exists.
What you could instead do is to call a batch-file per EXECUTE which does all the wanted work. Here an example what is meant: Run-Excel-from-QMC
The following Help link should provide further information along the lines Marcus was discussing along with an example. If you are just trying to detele a Temp file though, why not simply make a call to system Delete function via Cmd.exe /c Delete filename...
To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question. I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.