Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Introducing a batch job on clsing the computer

    Dear loungers,

    I want to introduce a batch file that will run when I do a shutdown. I want to do is use normal shutdown from the windows menu and when this runs it should run a given batch file before starting shutdown.So two questions:
    • is this possible and how?
    • if I have a batch file does each line get initiated and completed before the next - if I run a sync job how can I ensure it is complete before the next line of the batch job is executed?

    Thank you.................................... liz

  2. #2
    3 Star Lounger jockmullin's Avatar
    Join Date
    Dec 2009
    Location
    St-Eustache,QC,Canada
    Posts
    239
    Thanks
    10
    Thanked 21 Times in 20 Posts
    Depending on the edition of Win 7, this is normally done via the Policy Editor.
    It can be done for most versions or editions by updating the registry (advanced).

    This article gives a good discussion of both options:
    http://en.kioskea.net/faq/3358-execute-a-script-a-startup-and-shutdown

    J
    ock

  3. #3
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Dear Jock,

    thank you I shal read and digest.... love your icon!

    liz

  4. #4
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Quote Originally Posted by lizat View Post
    if I have a batch file does each line get initiated and completed before the next - if I run a sync job how can I ensure it is complete before the next line of the batch job is executed?
    In normal circumstances that's what happens - if you want stuff to run in parallel then START (without /WAIT) can achieve this somewhat unusual result.
    BATcher

    Time prevents everything happening all at once...

  5. #5
    Super Moderator jwitalka's Avatar
    Join Date
    Dec 2009
    Location
    Minnesota
    Posts
    6,793
    Thanks
    117
    Thanked 798 Times in 719 Posts
    Why not just add the shutdown command to the end of the batch file and use that when you want to shutdown. (Shutdown -s for a normal shutdow, shutdown -r for a restart)

    Jerry

Tags for this Thread

Posting Permissions

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