changing file permissions

I’m having an issue with files sent across a network not allowing write access. We have tried to change permissions settings on the involved computers with no luck. Is there a way to force write access with an Applescript/shellscript?

Of course not !!
Unless you have username and password of a privileged user.
In this case you can use a shell script with administrator privileges

Hi, my first post here
I am totally new to applescript and I want to make a program of some terminal commands

I have a similar issue

I want to change file permissions on a kext
here is my applescript:

do shell script “sudo chown -R root:wheel mykext.kext” with administrator privileges
do shell script “sudo chmod -R 644 mykext.kext” with administrator privileges
do shell script “/bin/sleep 2”
do shell script “sudo kextload mykext.kext” with administrator privileges

if I run those commands in the terminal, it’s np
but does not happen anything if I run that applescript

thoughts?

Hi,

sudo is the same as with administrator privileges. Apple recommends to omit it
See also: do shell script in AppleScript


do shell script "chown -R root:wheel mykext.kext" with administrator privileges
do shell script "chmod -R 644 mykext.kext" with administrator privileges
do shell script "/bin/sleep 2"
do shell script "kextload mykext.kext" with administrator privileges

hi stefan, thanks for the quick response

I tried removing the sudo but still get same result.

I tried it in automator too. It does not prompt for password so it complains no askpass program specified
however after some time of messing around the automator app ran, probably because I just authenticated myself just a while ago

the automator code did the job. but still can not authenticate the user. after a relog the automator app keeps failing cause there is no authentication.

have it like this:
http://krull.se/code.png

so there is nothing wrong with the code

is there someway to prompt for pw with the automator?

why is the applescript not working?

thanks again

You have to specify the whole path. Just the file name points to the top level of the startup volume
Probably


do shell script "chown -R root:wheel /System/Library/Extensions/mykext.kext" with administrator privileges

/ignore

sorry, I edited my example above, it specifies the path to the Extensions folder of the System

yes thank you. I got it working. lets see if I can finish this

I have a problem

I can’t load a kext

do shell script “sudo mv -v ATIROMFlasher.kext /System/Library/Extensions” with administrator privileges
do shell script “rm -rf /System/Library/Extensions.mkext” with administrator privileges
do shell script “sudo chown -R root:wheel /System/Library/Extensions/ATIROMFlasher.kext” with administrator privileges
do shell script “sudo chmod -R 644 /System/Library/Extensions/ATIROMFlasher.kext” with administrator privileges
do shell script “/bin/sleep 1”
do shell script “sudo kextload ATIROMFlasher.kext” with administrator privileges

everything runs except the kextload:

→ error “/ATIROMFlasher.kext failed to load - (libkern/kext) not found; check the system/kernel logs for errors or try kextutil(8).” number 71

is there a way to kextload a kext on root drive?

same (user) error, the argument must contain the full path

do shell script "sudo kextload /System/Library/Extensions/ATIROMFlasher.kext" with administrator privileges

It works, many thanks!