Check out ON SHUTDOWN. If you put ON SHUTDOWN QUIT at the beginning of your program you shouldn't have any problem.
>Hi,
>I have a simple program that runs with a system tray icon using the library from UT files. It consists of a do loop with an adir command scanning a directory for a file. the problem is that when i try to shutdown windows the program gives me a window saying cannot close visual foxpro. I want this program to be running in the background and to be closed on windows shutdown.
>
>Any suggestions?
>
>Thanks in advance
>~Quinn