I know that there are threads about this, I found this one: How to schedule a task to run when shutting down windows but it fails for me.
I wrote a little program in LabView and made an exe out of it. It runs perfect when I double click the exe in normal windows operation (it takes just a few seconds to complete). Then I put the exe in a batch file and that batch file in the group policy as a shutdown script. The result is that the computer hangs when shuting down. It shows the shutdown screen for minutes and I have to power cycle the PC to start it again. I even tried only a simple file copy command in the batch file with the same result. What am I doing wrong? Any hints are greatly welcome
Thanks a lot
Martin
thank you for your answer, it made me try some more things and now I was successful. I want to give some results here, maybe they help someone else:
It's really nice to see my small program run just before shutdown
Thanks again for your help
Martin
I had to enable another option to make my AutoHotKey script (which i compiled into an .exe) before shutdown. The script would open an Excel file and add some values. In order to make it work I also had to enable the "Specify maximum wait time for Group Policy Scripts".
Just to make it more clear all the steps I had to do in Windows 10 set to UK English:
Whenever I shutdown I first see the "Shutting down" and then the screen becomes black, it runs the script (opening Excel), closes Excel and then really shuts down.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.