MobiControl Tips & Tricks


Q1. Can I execute scripts on the mobile device to accomplish various tasks? If so, what kind of tasks can I accomplish?

Q2. How can I force my mobile device to wake up from standby mode and establish a connection with MobiControl?

Q3. How do I use "custom" information to name my mobile devices (e.g. the device owner's name)?

Q4. How do I run a MobiControl script on my mobile device every time on startup?

Q5. How do I create shortcuts to Windows settings or features on my mobile device, with a lockdown menu?

Q6. How can I send custom message to the MobiControl Deployment Server?


Q1. Can I execute scripts on the mobile device to accomplish various tasks? If so, what kind of tasks can I accomplish?

There are various options available to you that allow for execution of tasks on your mobile device. The following tasks can be accomplished using commloader.exe with any of the following switches.

Switch Purpose
-app Run CommLoader.exe as an application instead of a service. (This is only applicable to an agent running on a Windows desktop platform such as Windows XP.)
-n <device name> Rename a device
-m <script file> Run a script file
-mm <script command> Run an inline script command
-g Reset advanced settings
-s Manual time synchronization
-connect Connect to the Deployment Server
-connect -connmgr Establish data connection (usually GPRS) if no data connection is available, and then connects to the MobiControl server.

Note:

This is the same as clicking the Connect button within the MobiControl Agent Applet.

-connmgr Establish data connection only (usually GPRS). It will do nothing if any data connection (e.g. WiFi, GPRS, or ActiveSync) is available.

Note:

Depending on how the device is configured, it may not open a GPRS connection even if it has the capability to.

-connect -connmgr -inet Establish Internet data connection (usually GPRS) and connect to the MobiControl server. A connection is attempted regardless of any available data connections (ActiveSync, Wi-Fi,etc.)
-connmgr -inet Establish Internet data connection (usually GPRS). It attempts to open a connection regardless of any available data connections (ActiveSync, Wi-Fi, etc.)
-connmgr -inet -hangup Disconnects the GPRS connection.

Note:

Does not apply to CDMA devices.

-disconnect Disconnect from the MobiControl Deployment Server
-install Install Windows agent (only applicable to an agent running on a Windows desktop platform)
-uninstall Uninstall Windows agent (only applicable to an agent running on a Windows desktop platform)
-pfx <pfxfile> -pwd <password> Import .pfx private key file. Some device may require a soft reset after importing.
-exit Exit the program
-syncfile Checks the Deployment Server to see if there are any files to sync. This switch performs the same operation as though a user were to right-click on a device in the Manager and select 'Sync Files Now'.

Note:

Device must be online for this command to complete successfully. It will not attempt to establish a connection if one is not present.

-syncpkg Checks the Deployment Server to see if new packages are available. If packages are available they will be downloaded and installed. This is similar to right-clicking on the device and selecting "Push Pending Packages to Device"

Note:

Device must be online for this command to complete successfully. It will not attempt to establish a connection if one is not present.

-installpkgs Immediately proceeds with the installation of ANY packages that it has downloaded but not yet installed because they are scheduled to be installed at a later time.

Note:

The Package will not show successfully installed in the MobiControl Manager until the device has connected to Deployment Server.

Examples:

  • To force a mobile device to establish a MobiControl connection with the MobiControl Deployment Server: \windows\startup\commloader.exe -connect
  • To run a custom script (*.cmd file) on a mobile device: \windows\startup\commloader.exe -m 1:\MyScript.cmd
  • To run a custom script (*.cmd file) from a lockdown menu, browse for the .cmd file in the Add New Menu Item dialog box when configuring the Lockdown Policy. Enter the file's location as the Program Path: "\windows\startup\commloader.exe, -m %22\MyScript.cmd%22" **

    ** The purpose of %22 is to emulate double quotes in the Lockdown menu. This is required when the file name or path has spaces in it.

Q2. How can I force my mobile device to wake up from standby mode and establish a connection with MobiControl?

In MobiControl v5.00, we added a function that allows you to send a message (SMS) to your mobile device which contains instructions that will wake the mobile device from its suspended state and force a connection with MobiControl Deployment Server. In MobiControlManager, right-click on a device and select Send message to a device and click Send message via SMS. Select Initiate Connection to MobiControl as the message type and check the box next to Activate data connection if not present if you want to activate the data connection. Please see the Sending Messages / Scripts page for more information on sending messages to mobile devices.

Q3. How do I use "custom" information to name my mobile devices (e.g. the device owner's name)?

In MobiControl, a mobile device can have its name based on a custom data value. This naming convention can be enforced once the mobile device has connected to MobiControl or when creating the Device Agent.

Example:

At the time of the Device Agent creation, let the agent device name be
%REG://HKEY_CURRENT_USER\ControlPanel\Owner?VN=Name%

Once the mobile device is online on MobiControl, a script needs to be written, inserted into a MobiControl package and then pushed down to the mobile device(s). The name of the mobile device will change automatically and you will see the new name in MobiControl Manager.

Script Example:

Set Temp=REG://HKEY_CURRENT_USER\ControlPanel\Owner?VN=Name
\Windows\Startup\Commloader.exe -n "%Temp%"

For more information about Commloader switches, please see Q1. Can I execute scripts on the mobile device to accomplish various tasks? If so, what kind of tasks can I accomplish? in this section.

Q4. How do I run a MobiControl script on my mobile device every time on startup?

In order to run a script on your mobile device every time on startup, you need to create a *.lnk shortcut on your mobile device and place this shortcut in its \windows\startup\ folder. This *.lnk shortcut will contain the instructions for the script to execute upon startup of the mobile device.

A shortcut is a plain text file saved with a .lnk extension and contains instructions to perform a task. This task could be launching a process, an application or a file.

To create a *.lnk shortcut, follow these steps:

  1. Open Notepad.
  2. Enter the instructions or commands that you want executed when the shortcut is run. (Please see below for information on these commands.)
  3. Save this text file with a *.lnk extension, e.g. MyShortcut.lnk.
  4. Place this shortcut in the \windows\startup\ folder on the mobile device.

Example:

NN#\windows\startup\commloader.exe -m "\Temp\MyScript.CMD"<CR>

If you wish to have the shortcut point to Windows settings and features, this shortcut is one line of text.

Command Description
nn# The "nn" variable represents the total size, in characters (including spaces) in the line of text following the # (pound) sign.
Commloader.exe

This is the program to be executed. It will always be the same for feature settings.

i

This is the index number of the feature setting you wish to run. Refer to the table below for the index numbers of the settings.

0

This represents the optional tab number to select.

<CR> This represents a carriage return. Instead of a true carriage return, today we press the ENTER key. (In other words, don't include the literal in your file.)

Sample Control Panel .lnk file:

nn#\windows\ctlpnl.exe cplmain.cpl,i,0<CR>

For a full list of the Control Panel options, please see Q5. How do I create shortcuts to Windows settings or features on my mobile device, with a lockdown menu? in this section.

Example:

If you are trying to enter the memory settings, you will notice there are three tabs at the bottom. When entering
ctlpnl.exe cplmain.cpl,4
this will open the Memory main tab in the memory settings, but if you enter
ctlpnl.exe cplmain.cpl,4,1<CR>
this will open the next tab in the Memory settings, which is storage card. If there are more tabs, use the next corresponding number. Tab numbering starts with zero.

Q5. How do I create shortcuts to Windows settings or features on my mobile device, with a lockdown menu?

To create a shortcut to a Windows setting, you can create a *.lnk as noted above, or you can create a shortcut within a lockdown menu.

To create a shortcut in the MobiControl lockdown menu (Please see the Device Lockdown page.) the format is windows\ctlpnl.exe, cplmain.cpl i 0.

 

Index Number Opens Example
1

Password settings

ctlpnl.exe, cplmain.cpl 1
2

Owner Information settings

ctlpnl.exe, cplmain.cpl 2
3 *

Power menu from settings\system

ctlpnl.exe, cplmain.cpl 3
4

Memory menu from the units settings

ctlpnl.exe, cplmain.cpl 4
5 About menu from the units settings\system ctlpnl.exe, cplmain.cpl 5
6 * Backlight settings (for only certain devices) ctlpnl.exe, cplmain.cpl 6
7

Screen Calibration settings

ctlpnl.exe, cplmain.cpl 7
8

Input settings

ctlpnl.exe, cplmain.cpl 8
9

Sounds and Notifications settings

ctlpnl.exe, cplmain.cpl 9
10

Remove Programs menu from the units \settings\system

ctlpnl.exe, cplmain.cpl 10
11

Menus settings

ctlpnl.exe, cplmain.cpl 11
12

Buttons settings

ctlpnl.exe, cplmain.cpl 12
13

Today settings

ctlpnl.exe, cplmain.cpl 13
14 *

PC Connections settings (works only for certain devices)

ctlpnl.exe, cplmain.cpl 14
15

Beam settings

ctlpnl.exe, cplmain.cpl 15
16

Clock and Alarms settings

ctlpnl.exe, cplmain.cpl 16
17

Configure Network Adapters settings

ctlpnl.exe, cplmain.cpl 17
18

Regional Settings settings

ctlpnl.exe, cplmain.cpl 18
19

Connections settings

ctlpnl.exe, cplmain.cpl 19
20

Phone settings (for only certain devices)

ctlpnl.exe, cplmain.cpl 20
22

Manage Certificates settings

ctlpnl.exe, cplmain.cpl 22
23

Settings and Bluetooth tabs settings

Tabs are numbered: 0, 1, 2, 3,…

ctlpnl.exe, cplmain.cpl 23

Notes:

  • Do not forget the comma. It is necessary to separate the command from its parameters. The examples described here are to be used in scripts only. If you wish to use these examples in the lockdown menu, or a .lnk file please refer to the syntax mentioned above.
  • If the particular program you wish to set up with a shortcut has several tabs for its settings, adding "1" or "2" after the defined number would enter the next tab.
  • The options mentioned above are general options and may not work on some devices.
  • The options marked * are not supported on Pocket PC 2003 O.S.

Q6. How can I send custom message to the MobiControl Deployment Server?

In MobiControl, you can have custom messages send back to the MobiControl Deployment Serverfrom the mobile device. This message will show up in the Log panel of the mobile device in the Devices view (tab) in MobiControl Manager.

Command Description
log <type> <message>

<type> is the type of message that should get associated. The options are error (-e), warning (-w), and information (-i).
<message> is the message that will be displayed in the device log in MobiControl Manager.

Command Execution

The only way to run this log command is to insert it into a script (*.cmd) file. Inside the script, you can specify the log command to send messages to the MobiControl Deployment Server during certain activity or at certain actions.

Example:

During an software push from MobiControl to your mobile device, you can use this command to send notification to the MobiControl at certain intervals during the software push.
log -i "Starting software push"