Question : how to close a program not kill it with batch scripting

Ive been searching for a command in batch that will close down outlook properly. As of right now i am using taskkill like this:
TASKKILL /S IPADDRESS /F /IM outlook.exe /T
is there a command that simulates a close?

thanks in advance

Answer : how to close a program not kill it with batch scripting

Actually I just found the answer. The attached code is in vbscript from http://chrislehr.com/2006/02/script-to-close-outlook-for-pst-file.htm and will gracefully close outlook (it is also easily modifiable to close exchange).

1:
2:
3:
4:
5:
On Error Resume Next
Set Outlook = GetObject(, "Outlook.Application")
If Err = 0 Then
Outlook.Quit()
End If
Open in New Window Select All
Random Solutions  
 
programming4us programming4us