1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Monitor shutdown event and write registry value

Discussion in 'Support' started by shoek, Oct 23, 2015.

  1. shoek

    Joined:
    Oct 7, 2009
    Messages:
    2
    Likes Received:
    0
    Hi,

    Fairly new TCC user here. I open a TCC window on login. It runs TCSTART.BTM and I'd like to set a background monitor going to watch for the OS shutdown event, and on that event write something to the registry.

    Is there a way to do this, even if the TCC window gets closed and re-opened during my OS session?
    The ON command seemed like it might work, but it appears to need the script running the whole time.
    The PROCESSMONITOR command seems interesting, since it creates a thread to watch for the event (I could watch for a core Windows process to shut down, for instance), but I'm not sure if the background thread stays around even if TCC is closed ... I'm guessing not.

    Maybe I could start a background TCC window via DETACH to watch for the event?

    Thanks for the help...
    -Steve
     
  2. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,301
    Likes Received:
    39
    Maybe create a shutdown script in the Local Group Policy Editor? I haven't tried it myself, but it seems like it should work.
     
  3. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    I _have_ tried that, and it does work.
     

Share This Page