3

When I want to run a program (.exe \ .bat) before Windows 7 Home Premium Logoff \ Restart I use the Task Scheduler and I set a custom event: Log: System, Source: Winlogon, Event ID: 7002 \ 4634 \ 4647 \ .....

The problem is that the program starts but the system closes before the program finishes, while it's running.

What can I do? (My O.S doesn't have gpedit.msc unfortunately)

fixer1234
  • 27,064
  • 61
  • 75
  • 116
user3133076
  • 145
  • 3
  • 5
  • 13
  • 1
    Perhaps give this a try (not sure if it'll work): Add `shutdown /a` to the start of the script (to abort the current shutdown), and then add `shutdown -s -t 00` to the end of it to initiate a new shutdown sequence when it's done. You may have to make a couple scripts or something to deal with reboot vs. shutdown vs. hibernation, etc. Are you on an Active Directory domain by any chance? – Ƭᴇcʜιᴇ007 Dec 22 '14 at 19:47
  • 1
    It doesn't work. The system closes anyway. It doesn't abort the shutdown. The help says "/A can only be used during the time-out period" – user3133076 Dec 22 '14 at 20:44
  • What edition of Windows is this? Pro, something else? – I say Reinstate Monica Dec 22 '14 at 20:48
  • Windows 7 Home Premium (no gpedit.msc unfortunately) – user3133076 Dec 22 '14 at 21:27
  • Could you have a shortcut to run this item , then use a shutdown command after, instead of fighting a closing down system to run a program then? Just have an assortment of shutdown batches? I use that method from toolbars (like docks) – Psycogeek Dec 22 '14 at 21:34
  • No, I need to use the standard mode (standard UI) to restart and shutdown the PC. – user3133076 Dec 22 '14 at 21:40
  • Try make a batch file which executes the task and then, at the end, have a shutdown command. – benscabbia Dec 22 '14 at 22:56
  • No, I have to restart and shutdown the PC normally – user3133076 Dec 23 '14 at 08:41

0 Answers0