The writeprivateprofstring Command

writeprivateprofstring is a general purpose script command that writes to (or deletes from) an agent side database, specifically to the registry under the PDB registry path, as well as to the pdb.ini file.

Important: writeprivateprofstring is a powerful script. Use with caution.

Syntax

Write writeprivateprofstring scripts using the following syntax:

writeprivateprofstring section [key] [value]

Where:

  • section is the name of the section in the .ini file to which the value will be written. If the section does not exist, it will be created. The name of the section is case-sensitive.
  • key is the name of the key. If the key does not exist in the specified section, it will be created. If this parameter is not entered, the entire section (including all entries within it) will be deleted.
  • value is the string to be written to the file. If this parameter is not entered, the key will be deleted.
Note: Use quotation marks if either the key or value contain spaces.

Examples

Description Syntax
Changes a device's name writeprivateprofstring Device DeviceName MyDevice
Changes the orientation of the display image of a device that is remote controlled.

Requires

  • Android
writeprivateprofstring RcOrientationFix manufacturer model value

Where

  • manufacturer is from android.os.Build.MANUFACTURER("ro.product.manufacturer") and falling back to android.os.Build.BRAND("ro.product.brand") if the manufacturer is unknown
  • modelis from android.os.Build.MODEL("ro.product.model")
  • value is one of the following:
    • CW for clockwise
    • CCW for counter-clockwise
    • NONE for no rotation
    • UPSIDEDOWN for upside-down
Specifies the minimum WiFi security level on a device

Requires

  • Android Enterprise
writeprivateprofstring DeviceFeature MinimumWifiSecurityLevel securityLevel apply featurecontrol

Where securityLevel is one of the following values:

  • 0 sets the WiFi security level to Open
  • 1 sets the WiFi security level to WEP
  • 2 sets the WiFi security level to WPA
  • 3 sets the WiFi security level to EAP LEAP
  • 4 sets the WiFi security level to EAP FAST
  • 5 sets the WiFi security level to EAP TTLS
  • 6 sets the WiFi security level to EAP TLS

writesecuresetting

The writesecuresetting script command has the same functionality as writeprivateprofstring except that the data that is being written is not logged.

Description Syntax
Modifies device system settings

Requires

  • Android Classic
  • Android Enterprise agent 13.7.1+
    • Plugin 1.16.0.100+
  • Android Enterprise
    • Managed devices
    • Agent: 13.7.1+
    • If running an Android version earlier than 9.0 Plugin: 1.16.0.100
writesecuresetting -sys parameter value

To see a list of available parameters, visit Android Developers Reference: Settings.System.

Examples

Use writesecuresetting -sys accelerometer_rotation 1 to enable screen auto-rotation. 0 disables auto-rotation.

Use writesecuresetting -sys screen_off_timeout 60000 to control how long (in milliseconds) until the device goes to sleep after being idle.

Modifies global settings

Requires

  • Android Classic
  • Android Enterprise
    • Managed devices
    • Agent: 13.7.1+
writesecuresetting -glo parameter value

To see a list of available parameters, visit Android Developers Reference: SetGlobalSetting.

Example

Use writesecuresetting -glo auto_time 1 to tell the device to use date, time, and time zone information pulled from the device's network.

Modifies secure settings.

Requires

  • Android Classic
  • Android Enterprise
    • Managed devices
    • Agent 13.6.0+
writesecuresetting -sec parameter value

To see a list of available parameters, visit Android Developers Reference: SetSecureSetting.

Example

Use writesecuresetting -sec skip_first_use_hints 1 to indicate that apps should bypass any initial launch hints.