Reboot after Showmessagebox == IDOK

YW
Yannick Weijenberg
Centric Netherlands BV

Hi,

I am trying the following script:

showmessagebox "Instaltie completed. System will reboot" NO_TIMER 5
if %ShowMessageBoxReturn% = IDOK goto Reboot
:Reboot
reset /s

Unfortunately the reboot starts right away and does NOT wait for me to press the OK button. Any idea how to fix this?

I am using SOTI 15.2 and these are scripts for Android Enterprise devices.

5 years ago
MobiControl - Android Script Engine
ANSWERS
D
DDMOD@SOTI
5 years ago

Hi Yannick,

Thanks for the interesting post!

Can you please replace the NO_TIMER to required seconds. In the below example, the device will reboot in 30 seconds.

showmessagebox "Instaltie completed. System will reboot" 30 5
if %ShowMessageBoxReturn% = IDOK goto Reboot
:Reboot
reset /s

Regards,

MD
Matt Dermody Diamond Contributor
5 years ago

I don't believe the If/then SOTI scripting is supported by Android devices.

YW
Yannick Weijenberg
5 years ago (edited 5 years ago)

I am afraid you are right Matt. None of the options is working. 

D
DDMOD@SOTI
5 years ago

Hi Yannick,

The "if" keyword works in the below scenario.

I tried the below script on one of my test devices with the latest android agent installed and it worked to reboot the device. Please try again and share the outcome.

showmessagebox "Reboot Device?" NO_TIMER 5 OK

if %ShowMessageBoxReturn% = IDOK goto Test

:Test

log -i "Success"

reset /s

Regards,

YW

Hi,

The device does reboot, that isn't the issue. Your script did the same as mine. It does NOT wait on the user to press 'OK' to start the reboot. Instead, the message pops up and then just reboots. 

I also tried to set the timer to 50 sec, didn't matter.

Im using Android Enterprise Agent 14.3.1.1050

D
DDMOD@SOTI
5 years ago

Hi Yannick,

I had tried it on a Android Plus device device and the script worked as expected. I will try again on Android Enterprise and provide you an update soon.

Regards,