2

I have a string in my vbscript file. I would like to execute the string as code. For example, the string could be 'msgbox("hello")'. However, the eval function only accepts numerical or string operations. How should I execute the code? I could always create a new file and write that string to the file, execute the file, and delete it, but I am looking for a better way to do this.

1 Answer 1

6

Perhaps surprisingly, you can do this with an Execute statement. It's even referenced in the documentation for the Eval function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.