Results 1 to 5 of 5

Thread: How to run a script when windows shutsdown in XP Home

  1. #1

    Thread Starter
    Addicted Member Witis's Avatar
    Join Date
    Jan 2011
    Location
    VB Forums Online Freedom Mode: Operational
    Posts
    213

    How to run a script when windows shutsdown in XP Home

    Hi I found a tute which explains how to run a script on shutdown via mmc and windows group policy object: http://www.tutorial5.com/content/view/157/47/ . The problem is that there does not seem to be a Group Policy Object available as a snap in for XP Home edition. Is there any way to do this in XP Home?

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to run a script when windows shutsdown in XP Home

    Is there a VB6 question here somewhere?

  3. #3

    Thread Starter
    Addicted Member Witis's Avatar
    Join Date
    Jan 2011
    Location
    VB Forums Online Freedom Mode: Operational
    Posts
    213

    Re: How to run a script when windows shutsdown in XP Home

    It turns out there is a scheduled tasks system tool on XP home, although it doesn't have an on user logoff option. If there are no windows tools to enable me to run code when a user logs off, eg to back up files, I may have to code a solution. Surely this must be a relatively common dev issue.

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to run a script when windows shutsdown in XP Home

    When the user logs off your running programs get notified and the QueryUnload and Unload events occur. That's where you clean up.

    Trying to trigger backup processes on logoff would make the logoff process take a long time, leaving the machine tied up so the next user must wait quite a while. It wasn't found useful enough to have a "run on logoff" in Task Scheduler so the option wasn't offered.


    On later versions of Windows when a PC has advanced power management capability you can have Scheduler wake up the machine off-hours to do backups, etc. Or you can always schedule backups to happen at some preset time every day, every week, etc.

  5. #5
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to run a script when windows shutsdown in XP Home

    This isn't really a "dev issue" because applications don't own the machine.

    Backup scheduling is an admin function, entirely separate from applications.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width