Run Script tasks can be used to run files on a network share on targeted computers. In general, Managed Software Delivery policies are more reliable and functional than using tasks to delivering software, but there are occasional situations where Run Script tasks are preferred. One such situation is for deploying BIOS Updates to many different models of computer, where each computer requires a different BIOS update file. This article presents an example Run Script task that deploys the appropriate BIOS Update to many different models of computer.
In preparation for the Run Script task the BIOS Update installation files are all given the same name (BIOSUpdate.exe) and are placed in different folders on the network share where the folder name matches the computer model the update applies to. The Run Script task will determine the appropriate folder by using the %PRODUCTNAME% token. Tokens are defined in Settings>All Settings>Notification Server>Task Settings>Tokens. To see the possible outputs for a token open its SQL query and delete the last statement starting with WHERE, then run the query in SQL Management Studio or a custom SQL Report.
To create a Run Script task go to Manage>Jobs and Tasks and browse to a folder where the task will be created. Right-click on the folder and select New>Task. In the popup window scroll down to the bottom of the task options and select Run Script. The task can be edited here or after clicking OK. In the BIOS update example the Script type: is set to "Command Script" and the following script is entered in the text box:
Finally, give the Run Script task an appropriate name, click Save Changes, and run it on targeted computers by clicking either Quick Run or New Schedule.