How To Use the Run Script Task to Run Installer Files from a Network Share


Article ID: 178477


Updated On:


Workspace Streaming (formerly AppStream)




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:

Net use X: "\\servername\AltirisSoftwareLibrary\D19A06F-C68A-4A37-AE37-A5FE-08759E86549B\Dell Bios Update\"

"X:\%PRODUCTNAME%\BIOSUpdate.exe" -nopause -noreboot

Net use X: /delete

In this example script the net use command on the first line maps a network drive named "X:" on the targeted computer to the shared folder on the server "servername". The second line runs the EXE installer file targeted computer without needing to deliver the file in a package. The third line is unnecessary but removes the X: network drive so users don't see it.

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.