Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm currently wanting to deploy a setup to around 300 Macs. I have all of it scripted and ready to deploy, excepting that I'm having trouble creating a working alias to a samba share from the command line. I tried creating an alias, and then copying it from one Mac to another, but it loses its status as an alias, and instead OSX opens it in TextEdit (the @ in ls -l is also missing). Even if this did work, from a hexdump, it also looks like the alias has machine-specific information that may not work on another Mac.

Say that I wanted to create an alias to 'smb://server/share' on the desktop from the command line, how would I do that?

The machines run Mac OS 10.6.

Thanks.

share|improve this question
    
"I tried copying it from one Mac to another, but it loses its status as an alias" -- have you made sure tocopy extended attributes as well as OS X metadata (esp. resource forks)? You could try to zip it up and unzip it on the other machine to preserve those –  Daniel Beck Jul 1 '11 at 8:10
    
Yeah, it loses the attributes. If I try to keep the attributes when copying it says something to the effect of chflags: Unauthorized. –  Matthieu Cartier Jul 1 '11 at 8:32
    
I should mention, it says that even if I copy the file as the superuser. –  Matthieu Cartier Jul 15 '11 at 11:52

2 Answers 2

I think you want mount_smbfs.

Dropbox may also be worth examining.

share|improve this answer
    
I don't want to mount it, I want to create an alias to it. –  Matthieu Cartier Jul 1 '11 at 22:21
    
I don't think there is a documented way of doing that from the command-line. The best option I see is to use mount_smbfs combined with a symlink, but I don't know that I fully understand the outcome you want. –  Somantra Jul 1 '11 at 22:35
    
This questions was similar: superuser.com/questions/62587/… –  Somantra Jul 1 '11 at 22:36
    
I don't want to mount and create a symlink, though, that's not suitable, because it would require manual remounting every single time (whereas the alias automounts it when initialised), which would defeat the entire point. –  Matthieu Cartier Jul 1 '11 at 22:38

When you are connected to the Samba share, do you have a folder for it in /Volumes? You could always Symlink to this folder.

Why don't you create an applescript or an shell script and put it on your desktop. The script would mount the share if necessary and enter it.

share|improve this answer
    
I tried this, but it does not work in the same way as a network alias. The alias can be used to mount the share and subsequently enter it. A symlink does not mount it, it simply complains that the path doesn't exist when it is not mounted. –  Matthieu Cartier Jul 21 '11 at 10:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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