Automatically run script when PC shuts down (Windows 10)

As my monitor doesn't work properly I came to conclusion that I need to write a simple command line script to fix it. Problem is that this script must be called whenever the PC starts or shuts down. I found out how to do the startup part, but I cant figure out how to automatically run the script when pc is shutting down.

In particular I need either scale up or down the resolution on startup/shutdown. In order to achieve that, the script goes something like this: nircmd setdisplay monitor:name2 1920 1080 32.

Is there any way of making it work?

Thank you very much for your input.

1 answer

  • answered 2020-10-23 11:44 Eggycapibara910

    You can configure it that the script runs everytime you shutdown your pc

    On this way you can also setup the startup here instead of puting it in the Autostart folder

    Open GPE by entering "gpedit.msc"

    In the left panel, select "Windows Settings" under "Computer Configuration."

    Double-click "Scripts (Startup/Shutdown)" in the right panel.

    Double-click "Shutdown" Click "Add..."

    Navigate to the folder containing the script you want to run.

    Click "OK."