Auto connecting a server in Ventura using command lines please in terminal?

Hi, have been struggling to get my asus router server to automatically connect on Mac Startup in Ventura, after new Ventura OSx install and running time machine backup. The problem is that Catalina used to auto hide the server finder page and connecting to server was troublesome then.

So if there's command line available to auto connect servers in the terminal app, I'd love to know. Have added first file on server drive to login items but its unreliable.

Would be good if the servers finder page was hidden as well with icon in the dock.

The same will apply in Sonoma & Monterey OSx's.

My connect to server prompt in Finder is smb://GT-AX11000-E550

Would much appreciate any help here,

Cliff

MacBook Pro 15″, macOS 13.6

Posted on May 29, 2024 2:20 AM

Reply
1 reply

May 29, 2024 9:55 AM in response to Goodc1

Use AppleScript. And if you don't have DNS running or you are making manual entries to your hosts file, use IP address instead of name as the URL.


An AppleScript example would be:


mount volume "smb://192.168.0.10/ShareName" as user name "youraccount" with password "yourpassword"


Replace the IP with the IP of your server. Replace ShareName with the name of the shared folder you are trying to mount. Replace youraccount with your user name on the server. Replace yourpassword with your server account's password. Please note, this exposes your password in plain text so protect this accordingly. You can leave "with password "yourpassword"" off the end if you want to be prompted each time.


When saving, save as an Application. Then run once manually to approve any PPPC/TCC prompts. Once done, the app can be added to your Login Items.


Hope this helps.

Auto connecting a server in Ventura using command lines please in terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.