I’m developing a shell script to deploy a Xojo Web app to a server running macOS.
Part of the script mounts the server as a remote volume:
open smb://$user:$password@myserver-M1.local/myfolder"
This works great, except the Finder shows the server as myserver-M1.local
whereas if I double-click the server from the Finder’s Network sidebar, then the server shows as myserver M1
In all cases, the server’s folder is mounted properly:
/Volumes/myfolder
This is a very minor cosmetic issue, but I’m wondering:
is there a way to mount a SMB server in macOS to have the display name match, so it doesn’t show the “.local” part, and I don’t end up with two instances showing in the Finder / Locations sidebar?
Well, I was 99% sure I tried that and it failed, but I just tried again this morning and it worked! My server name is upper & lowercase, and I think I might have had a typo?
To clarify: it appears that you do not need the .local part, but if your server name has a space in the name, you have to replace the space with a dash (-) to get it to work.
So if your server name is: MyServer M1 this name is set via System Preferences / Sharing / File Sharing / Computer Name
you would open the smb URL as
open smb://user:password@MyServer-M1/myfolder
where ‘myfolder’ is the name of a folder shared on the server.
This appears to have the same end results as double-clicking the server name from within the Finder’s Network tab.