This Video will show how to achieve run time persistence in metasploit to create persistence backdoor in windows.We will create a AutoRunScript which invoke our listed commands once we get a shell in metasploit.

source