Temporarily Disabling Nvidia GPU with devcon.exe and AutoHotkey: Secondary Display Issue

Abstract: Fix secondary monitor black screens by temporarily disabling the Nvidia GPU using devcon.exe and AutoHotkey without rebooting.

Created: 2026-09-01 by
To resolve secondary display issues on Windows, you can temporarily disable the Nvidia GPU using devcon.exe via an AutoHotkey script. This method allows you to switch to integrated graphics without rebooting, fixing black screens or detection failures on specific monitors.

Understanding the Problem

Many users with hybrid graphics laptops or desktops encounter situations where a secondary monitor fails to light up after waking from sleep, connecting via a dock, or switching applications. The Nvidia driver may hang, causing the output port to remain inactive while the primary display works fine. Restarting the computer is often the most reliable fix, but it interrupts your workflow and closes open applications.

Disabling the discrete GPU forces the system to route all video output through the integrated graphics processor (iGPU). This action resets the display pipeline and often restores functionality to the secondary port immediately. Using devcon.exe provides a command-line interface to manage hardware devices, while AutoHotkey automates the process for quick access.

Preparing the Environment

Before creating the automation script, you must obtain devcon.exe. This utility is part of the Windows Driver Kit (WDK) or can be downloaded separately as the "DevCon" tool from Microsoft's official archives. Ensure you download the version that matches your system architecture (x64 for modern 64-bit Windows).

Place devcon.exe in a permanent directory, such as C:\Windows\System32, so it is accessible from any location without needing to specify the full path every time. If you prefer not to modify system folders, create a dedicated folder like C:\Tools\DevCon and add this path to your system's PATH environment variable.

You also need AutoHotkey installed. Download the latest stable version from the official website and install it. This software will allow you to create a simple script that triggers the device disabling command with a single keyboard shortcut.

Identifying the Nvidia Device ID

To disable the correct hardware component, you need its Hardware ID (HWID). Open Command Prompt as Administrator and run the following command:

devcon findall *NV* | findstr "PCI"

This filters the output to show PCI devices associated with Nvidia. Look for the entry corresponding to your graphics card. It typically looks like PCI\VEN_10DE&DEV_1C8D&SUBSYS.... Note the entire string starting with PCI\VEN_10DE. This identifier is unique to your specific Nvidia GPU model and is required for the devcon commands.

If you have multiple Nvidia devices (such as a high-performance GPU and a lower-power one), ensure you identify the correct one by checking the DEV_ code against your known specifications or by observing which device disappears from Device Manager when disabled.

Creating the AutoHotkey Script

Open Notepad or any text editor and create a new file named NvidiaToggle.ahk. You will write two hotkeys: one to disable the GPU and one to re-enable it. Replace [YOUR_HWID] with the actual Hardware ID you identified in the previous step.

; Disable Nvidia GPU
^+F1:: ; Ctrl + Shift + F1
RunWait, devcon disable [YOUR_HWID], , Hide
MsgBox, Nvidia GPU Disabled. Please check your displays.
return

; Re-enable Nvidia GPU
^+F2:: ; Ctrl + Shift + F2
RunWait, devcon enable [YOUR_HWID], , Hide
MsgBox, Nvidia GPU Enabled. Drivers are reloading...
return

The RunWait command ensures the script pauses until devcon finishes executing. The Hide parameter prevents a command prompt window from flashing on screen. The MsgBox provides visual confirmation of the action.

Save the file. Right-click it and select "Compile Script" if you want to convert it into an executable (.exe) for easier distribution, or simply double-click it to run the script in memory. To make it persistent across reboots, place the .ahk file or the compiled .exe in your Windows Startup folder (shell:startup).

Executing the Toggle

Once the script is running, press Ctrl + Shift + F1 to disable the Nvidia GPU. Your secondary monitor should turn off briefly and then potentially reconnect if it is supported by the iGPU. If the monitor remains black, try unplugging and replugging the cable, or changing the input source on the display.

To restore normal operation, press Ctrl + Shift + F2. This re-enables the device, prompting Windows to reload the Nvidia drivers. You may see a brief period where the screen flickers or goes black as the driver initializes. After a few seconds, both the Nvidia GPU and your secondary display should function normally again.

This approach is particularly useful for troubleshooting connection issues with USB-C docks or HDMI adapters that may not initialize correctly alongside the active discrete GPU. For other hardware stability issues, such as those involving peripheral power management, you might find relevant information in our guide on Windows 11 PC: Steelseries Rival 5 Mouse Completely Dies After 0-25 Times USB Power Toggle - Power Port Fixes.

Troubleshooting Common Errors

If you receive an "Access Denied" error, ensure your AutoHotkey script is running with Administrator privileges. Right-click the script icon in the system tray and select "Run as Administrator." Without elevated permissions, devcon cannot modify hardware states.

If the script fails to find the device, verify that the Hardware ID is copied exactly, including case sensitivity. Some systems may report the device under a slightly different subclass. You can also use devcon status [YOUR_HWID] to check if the device is currently enabled before attempting to disable it.

In rare cases, disabling the GPU may cause system instability if certain applications rely heavily on it for non-display tasks (such as CUDA computing). Always close resource-intensive applications before toggling the GPU state. For broader system stability concerns, refer to our article on Troubleshooting Windows Blue Screen if you experience crashes during the transition.

Frequently Asked Questions

Will disabling the Nvidia GPU affect gaming performance?

Yes, disabling the discrete GPU forces all rendering to occur on the integrated graphics processor, which is significantly slower. Games will likely become unplayable or run at very low frame rates. This method is intended for display troubleshooting only, not for performance optimization.

Can I use this method on a desktop PC with no integrated graphics?

No, if your CPU lacks integrated graphics, disabling the Nvidia GPU will result in a black screen with no video output. You would need a second monitor connected directly to another available video output or a remote desktop connection to re-enable the device.

Does this reset the Nvidia Control Panel settings?

No, your display configurations, resolution settings, and driver preferences are stored in the registry and profile files. Disabling and re-enabling the hardware does not wipe these settings. However, you may need to manually adjust the primary display assignment if the iGPU becomes the default adapter.

Is there a risk of damaging my hardware by disabling the GPU?

There is no risk of physical damage. Software disabling of a PCIe device is a standard operating procedure within Windows. The worst-case scenario is a temporary loss of video output that requires a reboot to restore, which is easily reversible.

Why does my secondary monitor stay black after enabling the GPU again?

Windows may not automatically re-detect the secondary monitor immediately after driver reload. Try pressing Win + P and selecting "Duplicate" or "Extend" to force the display layout to refresh. Alternatively, disconnecting and reconnecting the monitor cable can trigger the detection handshake.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More