# Delete file then run file at startup

I'm running the music player Foobar2000 through Wine at startup. For some reason when I shutdown Ubuntu the Foobar2000 process is ended abnormally in Wine and when it runs next time I get an annoying "start in safe mode?" message. Not a huge problem, but I'd like it fixed.

The safe mode message only appears if a file called "running" is present when Foobar2000 starts (if it isn't deleted when closed properly). So by deleting "running" then starting Foobar2000, the message doesn't appear.

I thought it would be easy enough to enter this as a startup command, however it doesn't want to work.

The command I am using is

rm '/home/henry/.wine/drive_c/users/henry/Application Data/foobar2000/running';'/home/henry/.wine/drive_c/Program Files (x86)/foobar2000/foobar2000.exe'


which works fine if I just run it from terminal, the file is deleted then foobar2000 runs.

Does anyone know why this isn't working at startup?

Also, will this run with a terminal visible? How can I make just the gui appear?

copy this command to a file winecleaner.sh

\rm -f '/home/henry/.wine/drive_c/users/henry/Application Data/foobar2000/running';'/home/henry/.wine/drive_c/Program Files (x86)/foobar2000/foobar2000.exe'

and then on the terminal run

chmod +x winecleaner.sh


and then run this program from terminal :

./winecleaner.sh


If it works fine then add this script to start-up application list

• Nope not working. And just to confirm, the file isn't deleted and Foobar2000 doesn't run at startup, I didn't actually mention that before. – Henry Gibson Nov 7 '12 at 19:05
• have you run chmod +x script-file ? – Vikash Singh Nov 8 '12 at 5:45
• Just done that and it has worked. Thank you. Not entirely sure what was wrong in the first place, maybe startup list just doesn't accept multiple commands in one.. – Henry Gibson Nov 8 '12 at 20:06
• maybe.. And please remove the -1 if its ok :) thanks :) – Vikash Singh Nov 9 '12 at 17:24
• I would love to however I apparently need 15 reputation first. I didn't vote it down in the first place I'm sorry. If I reach 15 I'll make sure to come back here because this has been very helpful. – Henry Gibson Nov 9 '12 at 21:49