How to redirect the output from desktop-entry

Viewed 205

I have a program called prg.exe written in C#. I want to run this program in mono with an argument (arg1) and redirect the output to a log file called log.txt.
If I open a terminal and enter the command:

mono --debug prg.exe arg1 > log.txt

everything works fine.
When the program is finished, the log.txt file is created, which contains any error.

Now I want to create a desktop entry called prg.desktop:

[Desktop Entry]
Name=My prg
Comment=some comment
Icon=/usr/share/pixmaps/openbox.xpm
Exec=mono --debug prg.exe arg1 > log.txt
Type=Application
Encoding=UTF-8
Terminal=false
Categories=None;

If I run prg.desktop, the log.txt file is not created.
What do I need to do to create the log file?

Thank you very much.

2 Answers

Can you try to give the absolute path to txt file? In many cases the file is usually created, just you can not see it.

something like :

[Desktop Entry]
Name=My prg
Comment=some comment
Icon=/usr/share/pixmaps/openbox.xpm
Exec=mono --debug prg.exe arg1 > /home/op/Programe/Consola/log.txt
Type=Application
Encoding=UTF-8
Terminal=false
Categories=None;
Related