I'm looking to run an exe file from the cmd of my raspberry pi but when I just put the path of the exe, I have :

Bash: MyPath.exe: Permission denied

I tried with sudo, but I have then:

sudo: MyPath.exe: command not found

Have you any idea to solve this please ?

| improve this question | | | | |
  • Are you trying to run a Windows executable on Linux? – kwasmich Dec 9 '19 at 13:37
  • Yes, this is a c# executable. I can execute it by click but not with the cmd ! – David Boltz Dec 9 '19 at 13:41
  • If the executable is in the current (working) directory, you must precede the name with ./ That is "./MyPath.exe" (without the quote marks). – Bob Brown Dec 9 '19 at 14:02
  • 1
    chmod 755 ./MyPath.exe may be needed to get over the "permission denied". – Dougie Dec 9 '19 at 14:38
  • It's ok, I found my answer (explain below) but I can't accept my own answer before 2 days... – David Boltz Dec 9 '19 at 15:08

Ok, as it is a windows executable, I need to use the mono cmd:

sudo mono MyPath.exe

And it works! Of course, you need to install mono before on your raspberry:

sudo apt-get install mono-complete
| improve this answer | | | | |
  • 3
    Why do you think you need to run with sudo? Don't do that unless you absolutely have to. – Dougie Dec 9 '19 at 16:47
  • I don't know, just to avoid permission denied, but why, can it be dangerous to use it everytime ? – David Boltz Dec 10 '19 at 8:55
  • Misuse of sudo means there's nothing to stop you destroying your system. You'll learn the hard way with sudo rm -rf / Do not try that. – Dougie Dec 10 '19 at 12:23
  • 1
    Oh ! Okay thank you for the explanation, I'm just beggining with raspberrys, I'll try to avoid it ! – David Boltz Dec 10 '19 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.