0

I have an SMB path that I need to browse to in the finder. I used to do this all the time with the following:

open smb://path/to/directory

I just updated to Big Sur and now every time I do this, I get the following:

The file /Users/myusername/smb:/path/to/directory does not exist

Is there some way to make it stop looking for the SMB path in the current directory?

1 Answer 1

1

Check man open from your Terminal.app:

% man open

Mine (Catalina) says:

The open command opens a file (or a directory or URL), just as if you had double-clicked the file's icon. If no application name is specified, the default application as determined via LaunchServices is used to open the specified files.

And so it depends on the LaunchServices database - which maps/associates certain files and actions with their applications. For example, an Excel spreadsheet *.xslx is associated with the Excel application; a dbl-click on a *.xslx file will launch Excel, and open the file you dbl-clicked. So that's how it works in general. Unfortunately, its construction is not very well documented, and may be useless in this instance. But, FWIW, you can view its contents like so:

% /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump> LaunchServicesDump.txt 

# open the output file in the pager `less`: 

% less LaunchServicesDump.txt 

# search or browse; I didn't find much useful here

The problem you seem to be having here is that the object of your open command: smb://path/to/directory may have had some meaning on your old system, but it has none on your new BigSur system.

You didn't explain, and so I will hazard a guess that there were other steps/commands used to enable this to work on your old machine. I think there are two solutions to your problem:

Solution 1. Use Finder to first create a connection

This may be what you did on your old system. Try this:

Step 1.

Open Finder, click the Go item in the Menu, and then Connect to server... (or ,K)

Step 2.

Enter smb://path/to/directory, and click the Connect button - alternatively, click Browse to open a Finder window with all known network hosts & select one.

Step 3.

A Finder window will open showing all the files & folders from that network share. After you close that Finder window, that connection should now be registered in your LaunchServices database; i.e. you may type open smb://path/to/directory in Terminal.app, and Finder will open to that share.

Solution 2. Use the CLI to mount the SMB server on a local folder

Step 1.

Read man mount and man mount_smbfs. mount_smbfs is referred to as a "helper app" for the mount command, and its man page will contain information on the options you'll need to use with mount.

Step 2.

Try to mount your SMB server from the CLI (Terminal.app) using something like this - adjusted for your server & network situation:

% mount -t smbfs //userid:userpwd@SMBserverURL/sharename /Users/macuserid/local_folder_mntpoint

Where:

  • userid - your user account name on the SMB server
  • userpwd - your user password on the SMB server
  • SMBserverURL - the IP address of your SMB server, or a recognized network name
  • sharename - the shared folder on your SMB server you wish to access
  • macuserid - your Mac username
  • local_folder_mntpoint - the directory/folder on your Mac's local drive to use as the mountpoint
Step 3.

Once your mount command has succeeded, you should be able to open Finder to your mounted drive as follows:

open /Users/macuserid/local_folder_mntpoint

or, if your mountpoint is in your $HOME folder:

% cd        # go to $HOME folder
% open local_folder_mntpoint

An Alternative:

An alternative to the manual mount as shown above is to set up an automount. That's probably best answered under another question.

1
  • Thanks for taking the time to leave such a thorough response. I'll try working through your suggestions as soon as I get a chance.
    – Keyslinger
    Commented Aug 9, 2022 at 23:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .