Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a bat file before windows shut down?

I am trying to run a BAT file immediately before Windows shutdown. I've tried the method shown in the question below:

Executing a batch script on Windows shutdown

However, the file does not run.

I did not specify any parameters for the BAT file (see attached image below):

enter image description here

Should I add parameters in order for it to run? I am on Windows 8.1.

like image 542
user3747357 Avatar asked Jun 21 '14 11:06

user3747357


1 Answers

Navigate to the Local Group Policy Editor, then the shutdown properties then add a script like you did, but use the scripts tab, not powershell scripts. You do NOT need to run it as a powershell script unless it pulls things from powershell specifically.

Hope this helps!

Example

like image 124
Eternal_Dusk Avatar answered Sep 30 '22 16:09

Eternal_Dusk