You don't need any script or any (very) dodgy way to do it....
PS: detecting "the file recieved... has completed" isn't possible with scripts either...
Just enter
shutdown.exe -s -f -c as the virus detection program in Messenger's options:
Tools > Options > File Transfer > Scan files for virusses with > shutdown.exe -s -f -c
Shutdown parameters & info:
http://www.microsoft.com/resources/documentation/...n-us/shutdown.mspx