You can automate the process of closing all files before closing a solution by adding a handler for the BeforeClosing event for EnvDTE.SolutionEvents - this will be called when VS exits.
VS2005 EnvironmentEvents :
Private Sub SolutionEvents_BeforeClosing() Handles SolutionEvents.BeforeClosing
DTE.ExecuteCommand("Window.CloseAllDocuments")
End Sub
Visual Studio 2008, , , , .
, .suo , , , , AfterClosing.