Running legacy commands from a file

Solved
T
Tomas
DHL Supply Chain Management GmbH

Hello,

Im currently looking into a way to execute script command that would be stored on a device to standardize execution script for our patching process.

The current script contains name of the file as well as version so I have to change the script every time a  change to package is done.

Is there a way to have script stored in a file, for example *.cmd file, and execute the script inside this file either through legacy commands or Javascript?

2 years ago
SOTI MobiControl
ANSWERS
RC
Raymond Chan Diamond Contributor
2 years ago

You can use Package Studio to include the .cmd script file as the pre-script of a .pcg package that does not have any apk or any other file included inside.  Deploy such package file, Your.pcg say, to each targeted device.  Every time you want to run the script, just use MobiControl script command

  installpackage   YourPcgFilePath\Your.pcg

Solution
RS
Rafael Schäfer
2 years ago

You don't need another javascript (where I'm currently not know if there's any possibility to run another "file") or legacy command to do this.

I recommend to do it like this way (a bit different from Raymonds solution):

  1. Build a package containing only the script as a (which you wanted to have in the cmd file)
    1. use post script
  2. (Optional: You could also add the update file into the package, then you have all at one place but maybe a big package)
  3. Provide the package via profile to the relevant devices 
    1. Profiles can be scheduled
  4. Save the same script also as a legacy script if you need to run it for support reasons manually on a device

+ Versioning because of the package
+ Can be scheduled
+ Can be executed manually
- Rebuild of the package needed and change of the profile\saved script as well when script changes

Possible also (depends on Mobicontrol version):

  1. Save the same script also as a legacy script
    1. if you need to run it for support reasons manually on a device it's also already there
  2. For rollout, deploy it as a Task profile to the relevant devices
    1. Profiles can be scheduled

+ Can be scheduled
+ Can be executed manually
+/- if someone changes script it also changes for the Task but also means every change is fast to be implemented
- no real Versioning because of no package

Please test, if you need to "re-rollout" the Task (Just click on edit and save&assign it again) when script changes or if the change of the script is enough if you use this method.

M
MPMOD@SOTI
2 years ago