# Custom Scripts - PowerShell, VB, Batch, Executable \[.exe]

### Creating the Script

To push a custom script using Faronics Deploy, the script will need to be hosted on a web server (see [Quick Guide to Self-Hosting Custom Scripts](https://docs.faronics.com/faronicsdeploy/custom-scripts-powershell-vb-batch/custom-scripts-library/quick-guide-to-self-hosting-custom-scripts) for further information). The supported scripts are PowerShell, VB Script, Batch Script and Executable \[.exe]. See the [Custom Scripts Library](https://docs.faronics.com/faronicsdeploy/custom-scripts-powershell-vb-batch/custom-scripts-library) for some example scripts.

### Adding Scripts to Deploy

Once the script is hosted, it can be added to the Faronics Deploy grid. To do this, go to the Custom Script button on the top right corner of the Applications Control Grid and select the drop-down arrow to Create Custom Script.&#x20;

![Create a Custom Script](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTElzvvVzBy4ilZBk4%2F-MVTMQo7yXAzeNjC65UE%2Fimage.png?alt=media\&token=7a0a3ba4-1ce4-4768-af51-34d6956c7572)

1\. Select the **Control Grid** tab on the top menu bar.

2\. Navigate to the **Applications** tab.

3\. Click **CUSTOM** **SCRIPT**.

4\. Select **Create** **Custom** **Script**.

5\. Enter a **Name** for the script.

6\. Enter the **URL** or **UNC path** (e.g., \\\FTS\Share\DFEscript.ps1 ) that points to the location where the script is being hosted.

7\. Select a script type, **Powershell**, **VB** **Script**, **Batch** **Script**, or **Executable \[.exe]** (PowerShell in this example).

8\. Select the account to **Run As**, either **System Accoun**t or **Specified User Account**.

9\. Click **SAVE TO GRID**.

{% hint style="info" %}
Once saved, the script can be pushed to an individual computer or groups of computers. It can also be scheduled using a Policy.
{% endhint %}

![Configure the Custom Script](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTElzvvVzBy4ilZBk4%2F-MVTHda52LhC9rRNX4s5%2Fimage.png?alt=media\&token=2f420ee2-5ce0-4e0b-829b-f5bc1ec6d849)

### Pushing the Script

If a custom script has been saved to the grid, it can be pushed out to computers immediately or at a scheduled time. Custom scripts will appear in the Applications Control Grid.&#x20;

![Locate Custom Scripts in Application View](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTZt5HGaC_PF0Yow_L%2F-MVT_TD6a4HmVUaVIJNr%2Fimage.png?alt=media\&token=4fe1bdfb-071b-46e0-b920-e3be925415ec)

1\. Select the **Control Grid** tab on the top menu bar.

2\. Navigate to the **Applications** tab.

3\. Select the Custom Scripts **column header**.

4\. Select the grid for the **Computer** that you want to run the Custom Script on (DESKTOP1 in this example).

![Run the Custom Script](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTZt5HGaC_PF0Yow_L%2F-MVT_x-nhcDxIiC0byIx%2Fimage.png?alt=media\&token=f05c9068-e7e6-48c9-a479-6aef0eebff8f)

5\. Click the **RUN** button.

6\. Confirm the action by clicking RUN on the confirmation dialog.&#x20;

<img src="https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTZt5HGaC_PF0Yow_L%2F-MVTaKvBEwaDdNytbG-M%2Fimage.png?alt=media&#x26;token=389e502a-cba0-42d0-9d13-90d0a78522df" alt="" data-size="original">&#x20;

{% hint style="success" %}
The Custom Script has successfully been run on the individual computer.
{% endhint %}

### Copy a Script (Duplicate)

A script can be duplicated or copied to another site.

![View Custom Scripts](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTElzvvVzBy4ilZBk4%2F-MVTMNaCB0MkKMduthyC%2Fimage.png?alt=media\&token=c85529d4-42ec-4aed-97a8-93f67391a37d)

1\. Select the **Control Grid** tab on the top menu bar.

2\. Navigate to the **Applications** tab.

3\. Click **CUSTOM** **SCRIPT**.

4\. Select **View** **Custom** **Scripts**.

5\. Select a Script to copy, then select the **COPY** drop-down menu.

![Select Duplicate](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTMcfyHaTMs1b9cSkM%2F-MVTMlm4sDG_qAU8KsXB%2Fimage.png?alt=media\&token=a2daf12a-1525-4485-8519-f1b8de802f00)

6\. Select **Duplicate**.

7\. The script will be named "copy of - xxxxxxx"; it's a direct copy with just the name change. Make any changes you require to the name, URL, Type, Run As, or Command-Line, then click **SAVE TO GRID**.

![Save Duplicate Script](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTMcfyHaTMs1b9cSkM%2F-MVTNG9pkW3cfToEAdaN%2Fimage.png?alt=media\&token=e4e2d23c-5da0-4235-90d0-b320bb54db72)

{% hint style="success" %}
The copied script will now appear in the list of Custom Scripts. It will also be available to select from the Applications Control Grid View.&#x20;

Search for the script in the grid using the search option. If your applications are grouped, you will see a column named **Custom** **Scripts**. Selecting the **Custom Script header** will display all the scripts that have been added to the grid.&#x20;
{% endhint %}

###

### Copy to a Site

![View Custom Scripts](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTElzvvVzBy4ilZBk4%2F-MVTMNaCB0MkKMduthyC%2Fimage.png?alt=media\&token=c85529d4-42ec-4aed-97a8-93f67391a37d)

1\. Select the **Control Grid** tab on the top menu bar.

2\. Navigate to the **Applications** tab.

3\. Click **CUSTOM** **SCRIPT**.

4\. Select **View** **Custom** **Scripts**.

5\. Select a Script to copy, then select the **COPY** drop-down menu.

6\. Check the box(es) next to the site(s) to copy the script.&#x20;

<img src="https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MRkQfx_2cLnNNBX1muO%2F-MVTOySsI6mfY-fxruY8%2F-MVTSxxwRts9rzuX2j9j%2Fimage.png?alt=media&#x26;token=9ccdf703-7f62-4e00-a3b5-d9a2716a8fff" alt="" data-size="original">&#x20;

7\. Click **COPY TO SITES**.

{% hint style="success" %}
The copied script will now appear in the specified sites in their list of Custom Scripts. It will also be available to select from the Applications Control Grid View.&#x20;

Search for the script in the grid using the search option. If your applications are grouped, you will see a column named **Custom** **Scripts**. Selecting the **Custom Script header** will display all the scripts added to the grid.&#x20;
{% endhint %}

### Edit a Custom Script

Once a script has been created, it can be edited. The name, URL, Type, Command Line and User can all be changed.

![](https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MRkQfx_2cLnNNBX1muO%2Fuploads%2F6whSC1Hdb8LhZLIctuLw%2Fimage.png?alt=media\&token=312c0d12-3576-4001-a283-f4a1cc1a2caf)

1\. Select the **Control Grid** tab on the top menu bar.

2\. Navigate to the **Applications** tab.

3\. Click on the name of the script to be edited in the header of the Applications Grid view (Disable Power Management in this example).

4\. The ACTION TOOLBAR will now appear; click the blue **EDIT DETAILS** button.

5\. If changing the URL, enter the new URL.

<div align="left"><img src="https://3007061244-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MRkQfx_2cLnNNBX1muO%2Fuploads%2FwJR5zichbyXtMxYNDv67%2Fimage.png?alt=media&#x26;token=c1ac34cf-959d-4f5e-8098-8153c298d361" alt=""></div>

6\. Select a new type from the drop-down list if changing the type.

7\. If changing/adding command line syntax, enter the new command line syntax in the box provided.

8\. If changing the User account running this script, select one from the drop-down list.

9\. Click the **SAVE TO GRID** button.

{% hint style="success" %}
The Custom Script has successfully been updated.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.faronics.com/faronicsdeploy/custom-scripts-powershell-vb-batch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
