Script Commands for macOS Devices
Use the options and examples below to help you create your own powerful script commands.
Legend
Format | Meaning |
---|---|
text |
Enter the command exactly as shown. |
text |
Replace with the requested information. |
[text] | Information contained within square brackets is optional to the command. |
text|text |
Choose one of the options separated by the vertical pipe. |
Commands
Command | Syntax |
---|---|
cd
Changes the current directory. |
cd [directory]
Example To change to the Chocolate directory:
|
copy
Copies one or more files to another location. On Windows Mobile/CE and Desktop Classic devices, you can copy files between desktop computers and mobile devices. On Android devices, you can only copy files locally. |
copy source
destination
Example To copy all files with the extension .txt from the C:\ to the temp directory on the device: C:\tempt\*.txt 1:\temp |
del
Deletes one or more files. |
del filename
Example To delete example.txt in the current directory:
To delete all files with the extension .tmp in the current directory and its subfolders:
|
install
Installs an application on the device. |
install appInstallerPath
Where appInstallerPath is the full path to the application installation file on the device Example To install the Team Viewer app whose installer is located on the desktop:
|
kill
Terminates a process that is currently running on the device. |
kill executable
Example To terminate the pword.exe process on the device:
|
log
Sends a customs message to the SOTI MobiControl deployment server from the device. This message appears in the Logs tab of the Device Information panel in the SOTI MobiControl console. |
log type message
Where
Example To send a notification to the SOTI MobiControl console at certain intervals during a software push: Note: Put the command in the pre-install script
|
mkdir or md
Creates a new directory. |
mkdir [drive:] path
Example To create a directory named "test" from the current directory:
To create
|
move
Moves a file from specified source location to specified destination location. Note: You can rename the file at the same time by specifying a name for the destination filename.
|
move [sourceFilePath] filename destinationFilePath [filename]
Example To move the file test.bat:
To move and rename a file at the same time:
To move folder to root folder:
|
rename
Renames a file or folder. |
rename sourceFilename destinationFilename
Example To rename the file
|
reset
Performs a soft or hard reset of the device. |
reset [/S] [/delaymin]
Where
Example To soft reset a device in 3 minutes:
|
rmdir or rd
Deletes a directory. |
rmdir [/S] path
Where On Android Plus and Linux devices, this command requires the
Example To remove an empty directory named "test" from the current directory:
To remove a directory named "test" and all of its contents from the current directory:
To provide location:
|
setdate
Sets the date and time. |
setdate date [time]
Where Example To set the date and time of the device
|
shellexecute
Launches the registered application for the given file extension. |
shellexecute filepath -verb
Where
Example To launch the registered application for the given file extension:
|
showmessagebox
Displays a message box on the device screen. |
showmessagebox message [timer] [type] [NOTIFY_DEVICE]
Where
Example To show a simple message:
To provide device information using a macro:
To set a 3 second timer to your message:
To add YES and NO buttons to your message box with no timer
|
sleep
Initiates sleep mode on the device for a set period. Only use this command in scripts. |
sleep [length]
Where length is in seconds Example To set the device to sleep for 5 seconds:
|
SYSTEM_SCRIPT_BLOCK Allows for multi-line macOS scripts by informing the device agent where a script starts. |
<SYSTEM_SCRIPT_BLOCK> |
/SYSTEM_SCRIPT_BLOCK Allows for multi-line macOS scripts by informing the device agent where a script ends. |
</SYSTEM_SCRIPT_BLOCK> |
writeprivateprofstring
Saves or deletes specified settings on a device. See The writeprivateprofstring Command for more information. |