If you're using that command from the command line and want it to evaluate variables, you need 2 /'s like:

//titlebar %variablename

otherwise it will just do what you said