SAMBA is the default sharing protocol on ZimaOS. With SMABA, you can access your photos, videos from another phone or computer, so that you can put data in one place and access or share them everywhere.
The specific benefits of SAMBA sharing are listed in this table:
SAMBA | USB drives | |
---|---|---|
Data Duplication? | No | Yes |
What devices? | Phones, TVs, Computers | USB ports equipped |
When and where? | Any time devices have a network | Where USB Plugged |
How many devices? | Many at the same time | One at a time |
Today, we will use CLI to connect ZimaOS’ folders on macOS and Windows.
For Mac Users
Open a text editor and copy these codes. We suggest VSCode as the text editor.
#!/bin/bash
# Prompt the user for IP address, username, and password
read -p "Enter IP Address: " IP
read -p "Enter Username: " USERNAME
read -p "Enter Password: " PASSWORD
echo ""
# Build the SMB URL
SMB_URL="smb://$USERNAME:$PASSWORD@$IP"
# Display connection information
echo "Connecting to: $SMB_URL"
# Open the shared path in Finder
open "$SMB_URL"
# Completion message
echo "SMB connection command executed. Check Finder for the result."
Save this to a file named like Connect to ZimaOS.sh
.
Open terminal and type bash
(do not miss the space). Then, drag the .sh file into the terminal app and press Enter to run the script.
This script will prompt you to input your ZimaOS’ IP address, username and password. Double check your inputs to ensure correctness. After confirmation, press Enter and you will be in your sharing panel.
For macOS users, you can drag the destination folder to the left panel to get quicker access in the future.
For Windows Users
Open Notepad.exe and copy-paste these codes:
@echo off
echo Please enter the following details:
set /p IP=Enter IP Address:
set /p USERNAME=Enter Username:
set /p PASSWORD=Enter Password:
:: Delete previous network drive if exists
net use \\%IP%\ /delete /y
:: Save credentials using cmdkey
cmdkey /add:%IP% /user:%USERNAME% /pass:%PASSWORD%
:: Map the network drive
net use \\%IP%\ /USER:%USERNAME% %PASSWORD% /PERSISTENT:YES
:: Open the network share
start explorer \\%IP%\
:: Pause for a moment to allow explorer to open the folder
timeout /t 2 /nobreak > NUL
:: Refresh the folder window using PowerShell
powershell -Command "
Add-Type -TypeDefinition @'
using System.Runtime.InteropServices;
public class WinAPI {
[DllImport(\"user32.dll\")]
public static extern bool SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
}
'@
\$HWND = (Get-Process | Where-Object { \$_.MainWindowTitle -match '%IP%' }).MainWindowHandle
if (\$HWND -ne [IntPtr]::Zero) {
[WinAPI]::SendMessage(\$HWND, 0x0111, [IntPtr]0x702C, [IntPtr]0)
} else {
Write-Host \"Window not found.\"
}
"
echo Commands executed successfully.
pause
Save that text file and give it a ‘.bat’ suffix. Now, click to run this script.
This script will prompt you to input your ZimaOS’ IP address, username and password. Double check your inputs to ensure correctness. After confirmation, press Enter and you will be in your sharing panel.
Windows users can right click the destination folder and choose the map network drive so that you can view your folders in This PC
panel.