Cotton please give more info. Can this be a program or batch file that runs your command, then shuts down? Or does it have to detect shutdown and run your program?
If the former, just make a .cmd file with 2 commands
shutdown /t 60
to shutdown one minute after the first command completes.
To run the first command without waiting(something quick) use the Start command as in
shutdown yadda yadda