copying data from windows network drive to Mac local drive

juicedaninja
New Contributor

Hello everyone,

so, I wrote this sh in terminal and when I tried to run this code, I couldn't copy files have admin rights to open file and edit in the local drive.

not sure what i'm doing wrong, is there different way to write this code so that I can access all the files that copied from network drive without changing to read/write access manually one by one?

read jamf sudo chmod 777 /Volumes/$jamf/network/desktop mkdir ~/desktop/desktop cp -rv /volumes/$jamf/network/desktop/ ~/desktop/desktop sudo chmod 777 ~/desktop/desktop
(put "" each line so could read the code better)

any ideas would be helpful to me.

Thank you

1 ACCEPTED SOLUTION

chris_kemp
Contributor III

If I understand you correctly, you're trying to chmod 777 a Windows network volume. That ain't gonna happen, Windows has a completely different permissions structure.

The second chmod, in ~/desktop/desktop (which really should be ~/Desktop/desktop - first one needs to be a capital D, assuming you're trying to put a folder called "desktop" on the local Desktop) should work - so assuming you have rights to read everything in the network folder you should be fine.

You could simplify further by focusing on the directory, but acting recursively on the contents. Try something like this:

# Copy recursively the directory "desktop" to ~/Desktop - note the lack of an ending / mark!
cp -rv /Volumes/$jamf/network/desktop ~/Desktop

# chmod recursively the folder just copied:
chmod -R 777 ~/Desktop/desktop

Hope this helps. :)

View solution in original post

2 REPLIES 2

chris_kemp
Contributor III

If I understand you correctly, you're trying to chmod 777 a Windows network volume. That ain't gonna happen, Windows has a completely different permissions structure.

The second chmod, in ~/desktop/desktop (which really should be ~/Desktop/desktop - first one needs to be a capital D, assuming you're trying to put a folder called "desktop" on the local Desktop) should work - so assuming you have rights to read everything in the network folder you should be fine.

You could simplify further by focusing on the directory, but acting recursively on the contents. Try something like this:

# Copy recursively the directory "desktop" to ~/Desktop - note the lack of an ending / mark!
cp -rv /Volumes/$jamf/network/desktop ~/Desktop

# chmod recursively the folder just copied:
chmod -R 777 ~/Desktop/desktop

Hope this helps. :)

juicedaninja
New Contributor

ohhhhhh

chmod -R 777 made it to able to open the file within the new folder that items copied.

Thanks for the help.