Command is allowed only in interactive mode (Error 1297)

You are attempting to use a command that is only allowed in interactive mode. This command can be issued only through the Command window.