Run.Command problem

  • Thread starter Shoogar
  • 5 comments
  • 594 views

Shoogar

Premium
637
Australia
Melbourne
Sweet-Shoogar
Hey there guys. Please link me if this has been asked before.

I'm having an issue with my Mac. I'm the only user on the computer, I have the admin powers :drool: but when I go to run any program that I code in a .command [Mac version of .bat] file, it tells me that I don't have the correct permissions and to check the get info page. According to the get info page, I have the ability to "Read and Write" and there are no other options. How come i'm getting this problem? 'Cause it's a pain when i'm trying to run programs.

Thanks.

EDIT: Here is the error i'm getting:







~~~~~FIXED~~~~~~~

If you are having the same problem, here is what you do!

Open terminal > paste "chmod a+x " > Drag file in to terminal > Press Return > Fixed.
 
Last edited:
chmod 755 batchscript?

I assume it's a file permissions issue?

I wouldn't understand why it would be a file permissions issue, i've coded and converted the note-pad file in to a run.command file. I'll happily video it for you if you think you have a solution.
 
It's definitely a rights issue. OSX file permissions work identical to UNIX/Linux. So if you create a new file and want to be able to execute it, you will have to assign 'execute' rights to it, not just 'read' and/or 'write'.

Just verified this on my MacBook Air. Create a new text file with the text editor, renamed it to 'blah.command', then tried to execute it. Result: fails with message about not having proper rights. Went into terminal, gave it execute rights. Result: command is executed.
 
It's definitely a rights issue. OSX file permissions work identical to UNIX/Linux. So if you create a new file and want to be able to execute it, you will have to assign 'execute' rights to it, not just 'read' and/or 'write'.

Just verified this on my MacBook Air. Create a new text file with the text editor, renamed it to 'blah.command', then tried to execute it. Result: fails with message about not having proper rights. Went into terminal, gave it execute rights. Result: command is executed.

So, how do I give it these rights? Thanks for the solution by the way 👍
 
Replied via PM already, but will post here too for others to profit. :)

Right click on your .command file and select 'show info'. Copy the location/path of the file. Open up a terminal, type 'cd ' at the command prompt and paste the copied file path after it. Then type chmod 755 whatever.command (replace whatever with name of your file). Should be fine after that. 👍

cheers

Lars
 
Back