Hi Dmitry,
What are the chances that there's a stray "SET LIBRARY TO" with no parameters somewhere in the code? That could cause your previously DECLARE'd ShellExecute to be un-declared which VFP would interpret as a missing ShellExecute.prg. That would also explain why it works some of the time, but not others.
~Erik Folley