There is no straightforward way to tell vim to land the cursor at a particular place in the cmdline during a map, but there are a number of workarounds.
autocmd FileType cpp nnoremap <F4> :RunWithFile ~/Downloads/ > output.txt && cat output.txt<c-r>=setcmdpos(getcmdpos()-31)<cr>
You can use setcmdpos() to ...
Normally prefer :h ftplugin over autocmd FileType. If still want autocmd, at least, put it into augroup.
Use :h map-<buffer> to define a local mapping. Otherwise it will affect all other buffers/windows too.
Typing foo[cursor]bar is as simple as bar<C-B>foo.