I am going to execute below simple hand written Coded UI test to launch a notepad, using a Console Application.
Create Console Application in VS 2012. Refer the Coded UI in the Console Application. Then add below references to below assemblies.
Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
Microsoft.VisualStudio.TestTools.UITest.Common.dll
Microsoft.VisualStudio.TestTools.UITest.Extension.dll
Microsoft.VisualStudio.TestTools.UITesting.dll
from C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\
Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll
from C:\Program Files (x86)\Common Files\microsoft shared\VSTT\11.0\
Microsoft.VisualStudio.TestTools.UITest.Framework.dll
Microsoft.VisualStudio.TestTools.UITest.Logging.dll
Microsoft.VisualStudio.TestTools.UITest.Playback.dll
from C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\
Then add below code to Console Application
This Console Application now can run Coded UI test.