Quote Originally Posted by Vadikan View Post
You can add command line switches without a batch file, there's a special Arguments field for that in Action. E.g.
/c echo hello>>%userprofile%\desktop\hello.txt

Certainly, CMD-file will work equally well.
Hi there
I think the question was not HOW to write a batch cmd but to make sure it RUNS at EVENT LOGOFF.

The question was how to ensure the command - or script runs at event logoff.

With these sorts commands just start with something simple so you know the event gets captured - for instance just display on the screen "Logging off at hh.mm.ss". Once you've got the event to trigger properly you can start messing around with the actual execution scripts -- and even have them run totally as background jobs.

Test SIMPLE stuff first as a POC (Proof of concept). - My experience is that people always delve into the most complex stuff too early in the development process.

Test your script SEPARATELY too -- so now once you've got the EVENT (LOGOFF) to trigger and your script working just match the two together --job done.