> For the complete documentation index, see [llms.txt](https://docs.patchmypc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patchmypc.com/patch-my-pc-publisher/customizations/list-customizations/predefined-scripts.md).

# Predefined Scripts option in Patch My PC Publisher

*Applies to: Patch My PC Publisher V3.x*\
*Available at level: Product*\
*Available on tab: WSUS Updates, ConfigMgr Apps, Intune Apps, Intune Updates*

Patch My PC (PMPC) defined pre- and post-scripts are provided for specific products that cannot fully manage certain scenarios on their own. A common example is software that is unable to remove older versions during an upgrade, such as Oracle Java.

The **Predefined Scripts** right-click option automatically downloads and bundles the PMPC pre- and post-scripts with the application or updates them whenever the application is published using Publisher.

## Required Scripts

**Required Scripts** are enforced and cannot be modified or disabled. They are always executed as part of the installation or update to ensure the application installs correctly.

## Recommended Scripts

**Recommended Scripts** are optional. Although they are included with the application or update, they can be disabled if you prefer not to use them.

<figure><img src="https://3773699522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MX7dvS0r_4fc0AikgJS%2Fuploads%2FfOYDqrZxZTRQfGIeK5l8%2Fimage.png?alt=media&amp;token=4dcdd26a-3dd2-4ab3-b540-ace47a3fdf66" alt="Recommended Scripts" width="563"><figcaption></figcaption></figure>

### To view the PMPC Recommended Script

1. Click the **Predefined Scripts** right-click customization option for the product in the Product Tree.
2. Click **View** to open the script in a browser and review its contents.
3. Review the **Description** field to understand what the script does and when it runs.

{% hint style="info" %}
**Note**

Recommended scripts are hosted by PMPC and are referenced by URL. They are not editable from the Publisher UI.
{% endhint %}

### Configure Script Behavior

The following options control how the recommended script behaves:

* **Don’t attempt software update if the pre-script returns an exit code other than 0 or 3010**\
  When enabled, the installation or update stops if the recommended script fails. This option is enabled by default and prevents the deployment from continuing if required cleanup actions cannot be completed.
* **Disable the Patch My PC recommended pre-update script for this product**\
  When enabled, the recommended script is skipped for this product. This option is available only for recommended scripts and does not apply to required scripts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.patchmypc.com/patch-my-pc-publisher/customizations/list-customizations/predefined-scripts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
