.desktop file not working [duplicate]

I have a .desktop file that contains these lines:

[Desktop Entry]
Name=Firestorm
Comment=Client for Online Virtual Worlds, such as Second Life
Exec=/home/deus/Programs/Firestorm_64bit/firestorm
Icon=/home/deus/Programs/Firestorm_64bit/firestorm_icon.png
Terminal=false
Type=Application
TargetEnvironment=Unity
StartupWMClass=do-not-directly-run-firestorm-bin
Categories=Application;Network;
StartupNotify=true

I just re-installed Ubuntu 14.04 before the reinstall this file worked just fine. Now it doesn't. I did set the exec property.

When I run it from terminal I get this:

deus@xxx:~/DesktopShortcuts$ ./firestorm.desktop 
./firestorm.desktop: line 1: [Desktop: command not found
./firestorm.desktop: line 3: for: command not found
./firestorm.desktop: line 10: Network: command not found

Can anyone tell me what the problem is and how to fix it?

Thank you.


Solution 1:

You can't open a desktop shortcut as an script, because the shell won't understand the command and it'll just try to execute line by line what's in the text file.

Try this:

gnome-open firestorm.desktop

If it doesn't work, it may be a problem of permissions. Try to do the file executable with:

chmod +x firestorm.desktop

or trought the properties menu that appears if you right click on the desktop file.