> For the complete documentation index, see [llms.txt](https://docs.hyperdbg.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperdbg.org/commands/scripting-language/functions/events/event_disable.md).

# event\_disable

### Function

> event\_disable

### Syntax

> event\_disable( EventId );

### Parameters

**\[Expression (EventId)]**

Event ID of the event that needs to be deactivated.

### Description

Disables an event by its Event ID.

### Examples

`event_disable(1);`

Disable an event with `EventId = 1`.

When an event is executed, the `$event_id` pseudo-register contains the target event's ID.

For example, you can force an event to be disabled immediately:

```
!epthook nt!ExAllocatePoolWithTag script {
 event_disable($event_id);
}
```

The above example, won't guarantee that only one event will be executed, as multiple cores might reach to the above code simultaneously. If you want to avoid multiple runs, you can use [interlocked](https://docs.hyperdbg.org/commands/scripting-language/functions/interlocked) functions.

### Remarks

You can see events' ID using the [event](https://docs.hyperdbg.org/commands/debugging-commands/events) command. The first column of [this command](https://docs.hyperdbg.org/commands/debugging-commands/events)'s results shows the event ID.

Starting from **v0.2**, this function is changed from `disable_event` to `event_disable`.

### Related

[event\_enable](https://docs.hyperdbg.org/commands/scripting-language/functions/events/event_enable)

[event\_clear](https://docs.hyperdbg.org/commands/scripting-language/functions/events/event_clear)


---

# 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 dynamically by asking a question.

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

```
GET https://docs.hyperdbg.org/commands/scripting-language/functions/events/event_disable.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
