Use "C-x (" and "C-x )" to make a keyboard macro that invokes the command and then type "M-0 C-x e".
WARNING: any messages your command prints in the echo area will be suppressed.