Deactivating a license automatically

Has someone or can someone create a macro or some bit of software to automatically deactivate Solidworks when closing it? The reactivation wouldn't be a problem because it would activate when you start it up. I deactivate mine at work every night when i leave to use it at home.