DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Run a bat-file on system shutdown  (Read 18,937 times)

Cotton

  • Participant
  • Joined in 2009
  • *
  • Posts: 3
Run a bat-file on system shutdown
« on: August 21, 2009, 11:19 PM »
I'm looking for a application that can run a bat-file when Windows Vista is going to shutdown/restart.

Does a application like this exist or would anyone like to create it?  :-*

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: Run a bat-file on system shutdown
« Reply #1 on: August 22, 2009, 12:33 AM »
This program will run a program before shutting down, but it's initiating the shutdown, not just detecting it.

http://www.autoitscript.com/forum/index.php?showtopic=86073&st=0&p=617608&hl=detect system shutdown&fromsearch=1&#entry617608

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: Run a bat-file on system shutdown
« Reply #2 on: August 22, 2009, 12:57 AM »
would anyone like to create it?  :-*
* scancode raises a hand. Give me a couple minutes.
I can't get it to work :(
Sorreh!
« Last Edit: August 22, 2009, 02:55 AM by scancode »

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: Run a bat-file on system shutdown
« Reply #3 on: August 22, 2009, 04:54 AM »
Cotton please give more info.  Can this be a program or batch file that runs your command, then shuts down?  Or does it have to detect shutdown and run your program?

If the former, just make a .cmd file with 2 commands
YourCommand.exe
shutdown /t 60

to shutdown one minute after the first command completes.
To run the first command without waiting(something quick) use the Start command as in

start yourapp.exe
shutdown yadda yadda

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Run a bat-file on system shutdown
« Reply #4 on: August 22, 2009, 04:56 AM »
you can try either Xecutor (free for non-commercial use) or LastChance (freeware).

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: Run a bat-file on system shutdown
« Reply #5 on: August 22, 2009, 10:05 PM »
Looks like DShutdown also has this option:

http://dimio.altervista.org/eng/

I've been using DTaskManager and it seems well done so I might as well give DShutdown a try.

shaunpud

  • Participant
  • Joined in 2009
  • *
  • Posts: 1
Re: Run a bat-file on system shutdown
« Reply #6 on: August 24, 2009, 09:36 AM »
Just use Group Policy

Example here

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • Coding Snacks
Re: Run a bat-file on system shutdown
« Reply #7 on: August 24, 2009, 08:53 PM »
Just use Group Policy

Example here

Not all versions of Windows have Group Policy Editor.  On my Windows7 eval it's Ultimate so I can keep Windows Media Player and IE from starting just using Group Policy.  On my Vista64 Home Premium I don't have it, so I have to employ a process monitor that kills them as soon as they rear their ugly heads.

Conquer

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 50
    • Coding Snacks
Re: Run a bat-file on system shutdown
« Reply #8 on: August 27, 2009, 04:12 PM »
I'm looking for a application that can run a bat-file when Windows Vista is going to shutdown/restart.

Does a application like this exist or would anyone like to create it?  :-*
here. it will run any program just edit the settings.ini file.

to make the program run on startup, place a shortcut
(not a copy of the program) to your startup folder.

program attached!
« Last Edit: August 27, 2009, 04:31 PM by Conquer »

Original address: https://www.donationcoder.com/forum/index.php?topic=19618.0