How to schedule a task to run when shutting down windows January 18, 2023 by Tarik Execute gpedit.msc (local Policies) Computer Configuration -> Windows settings -> Scripts -> Shutdown -> Properties -> Add