Hi John,
>It works only if I run "after" VFP finished loaded. If I place it in a prg and set as startup program, then I will get error "window 'command' is not defined.
As Fred says, the command window should be active by default when VFP is done... However, in case something strange with restoring docked windows is causing the problem, you could launch a timer in the startup program. The timer would attempt to activate the command window. If it succeeded, it would relase it self.
If you don't mind reconfiguring fonts and window positions, you could also rename your FOXUSER.DBF file and start with a fresh one.
--
Christof