Results 1 to 3 of 3

Thread: utility which should run before computer shutdown

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Location
    India
    Posts
    9

    utility which should run before computer shutdown

    Hi
    I want to make a utility which should run before computer shutdown(automatically) and copies some of the specified folders to
    a back up machine.

    pls. Advise.
    rgds.
    Avnish

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    there's nothing in VB that catches shutdown --- maybe there's something in the API --- check out the API documentation

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    You would have to experiment with this, but theoretically it sounds like it might work.

    Write a VB program that sits in the System Tray and starts when the machine starts. When Windows shuts down (Normal shutdown - if someone hits the power button or the machine crashes, you are screwed) it will close running programs. You could place code in the Query_Unload event of your VB program that does your folder copy.
    VB Code:
    1. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    2.     If UnloadMode = vbAppWindows Then
    3.         'windows is shutting down
    4.         'your folder copy code goes here
    5.     End If
    6. End Sub
    Try it and let us know.

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