--- title: "system.vision.closeWindow" description: "Given a window path, or a reference to a window itself, it will close the window." --- # system.vision.closeWindow > Given a window path, or a reference to a window itself, it will close the window. :::info Backwards Compatibility This function replaces [system.nav.closeWindow](versioned_docs/version-8.1/appendix/scripting-functions/system-nav/system-nav-closeWindow.md). Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. ::: This function is used in **Python Scripting**. ## Description Given a window path, or a reference to a window itself, it will close the window. If the window can't be found, this function will do nothing. :::note This function is available on secondary desktops via the [system.vision.desktop](system-vision-desktop.md) function. See the [Multi-Monitor Clients](ignition-modules\vision\common-tasks-in-vision\multi-monitor-clients\multi-monitor-clients.md) page for more details on secondary desktops. ::: ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax #1 (FPMIWindow Param) `system.vision.closeWindow(window)` ### Parameters Type | Parameter | Description ------- | ------- | ------ FPMIWindow | `window` | A reference to the window to close. ### Returns Nothing ### Scope Vision Client ## Syntax #2 (String Param) `system.vision.closeWindow(windowPath)` ### Parameters Type | Parameter | Description ------- | ------- | ------ String | `windowPath` | The path of a window to close. ### Returns Nothing ### Scope Vision Client ## Code Examples ```python title="Example #1" # This example gets the window named 'Overview' and then closes it. # If the window isn't open, a warning is shown. try: window = system.vision.getWindow('Overview') system.vision.closeWindow(window) except ValueError: system.vision.showWarning("The Overview window isn't open") ``` ```python title="Example #2" # This example would close the window named 'Overview' in one step. # If the window isn't open, the call to closeWindow will have no effect system.vision.closeWindow('Overview') ```