Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Windows › Make program run at shutdown?
New Posts  All Forums:Forum Nav:

Make program run at shutdown?

post #1 of 14
Thread Starter 
I am not that familiar with batch or Vb scripts, but is it possible to have one run at shutdown, interrupt the shutdown, and then ask if you are sure you want to shut Down? I want to be able to do this because whenever I am backing up my brother's computer, i always tell him to not turn off his computer. However, he always turns it off. This way, I will be able to remind him to not shut down the computer. Is this possible?

Thanks.
post #2 of 14
That is possible when the computer is added to a windows server domain. I don't think it's possible in a workgroup.
CM Thuban
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II x6 1075 @4GHz 1.42v ASUS M4A89TD Pro USB3 Sapphire AMD RADEON HD6850 1GB GDDR5 4 GB G Skill Flare CL7 
Hard DriveOptical DriveOSMonitor
Western Digital Velociraptor LG DVD-RW Dual layer SATA Mshit W7 Ultimate x64 Lg 24" Led 
KeyboardPowerCaseMouse
hp vista basic PS/2 Corsair TX650W Cooler Master CM690 lenovo usb 
Mouse Pad
CMStacker 
  hide details  
Reply
CM Thuban
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II x6 1075 @4GHz 1.42v ASUS M4A89TD Pro USB3 Sapphire AMD RADEON HD6850 1GB GDDR5 4 GB G Skill Flare CL7 
Hard DriveOptical DriveOSMonitor
Western Digital Velociraptor LG DVD-RW Dual layer SATA Mshit W7 Ultimate x64 Lg 24" Led 
KeyboardPowerCaseMouse
hp vista basic PS/2 Corsair TX650W Cooler Master CM690 lenovo usb 
Mouse Pad
CMStacker 
  hide details  
Reply
post #3 of 14
Thread Starter 
I don't need to do it over a network. I can manually enable/disable it from the computer itself whenever I put on the backup. I just don't know how i would be able to have it run at shutdown.
post #4 of 14
Quote:
Originally Posted by Jtvd78 View Post
I don't need to do it over a network. I can manually enable/disable it from the computer itself whenever I put on the backup. I just don't know how i would be able to have it run at shutdown.
Heres the pseudo PSEUDO code
Have a program check if the computer is going to shut down, display confirmation message about shutdown, if answer is yes then the program will close and let shutdown continue, if answer is no program will interupt SD.

OR

If you want to do it a better way put a sticky note above his monitor on the rim that has bright colors on it and shapes, it should say "HEY DUMB@$$ dont shut me down if im transfering files"
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
Oppress This!
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom 2 X4 B55BE @ 3.7 ASUS M4A89GTD-PRO USB3 GTX 470 + GTX 275 SOC 4gb Crucial Ballistix T 1600 6-8-6-20-24 1T 
Hard DriveOptical DriveOSMonitor
2xWD640AAHLS + Hitachi 2TB 7200RPM + 2x150gb VRapt HP IDE + LG SATA Win 7 x64 ult 15" 1024x768 Dell (visually impaired) 
PowerCase
XFX XXX 650w (green fan) Antec 300 (Heavily Modded) 
  hide details  
Reply
post #5 of 14
Don't mean to completely hijack here, I am also struggling to interrupt a shutdown.

Our Pseudo-Pseudo:

User logs off / restarts / shutdown, immediately prompted with " Have you done your timesheet?"

Choose Yes, system continues to logoff, restart, shutdown

Choose No, launch default browser to a defined website. When default browser is closed, system should continue to logoff, restart, shutdown.

Right now if we choose No, browser tries to start, but system shuts down anyway.

The real challenge I think is capturing the method of shutdown( logoff, restart, shutdown), then making the system wait until the browser is manually closed, then take the captured method and continue through with the action.

Any thoughts? Should I post a new thread?
post #6 of 14
Thread Starter 
I know that you can run shutdown -a command in windows to cancel a shutdown, but I don't know how to run a program at shutdown.
post #7 of 14
gpedit.msc

would a powershell script for you?
Edited by Macnemarion - 5/31/11 at 8:45pm
post #8 of 14
ya know what instead of a script see if this will work for you

http://code.mincus.com/4/shutdown-monitor/
post #9 of 14
Which version of Windows are we talking about? I'm not aware of a way to do this at all, you can prevent him ever shutting the PC down, but I don't know a way (outside of a script) to only prevent it at certain times
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
Little Beast
(12 items)
 
Black 'n' blue II
(15 items)
 
 
CPUGraphicsRAMHard Drive
Intel Core i7-4710MQ Nvidia Geforce GTX860M 2GB 16GB Kingston DDR3 1600MHz 240Gb Silicon Power S55/S60 SSD 
Hard DriveOSOSMonitor
1Tb Toshiba HDD 5400rpm Windows 8.1 Linux Mint 18 17.3" LED 1920x1080 
CaseMouseMouse PadAudio
PCSpecialist Optimus V ST17-860 Logitech MX518 Steelseries QcK Creative HS800 Fatal1ty 
CPUMotherboardGraphicsRAM
Core i7 860 @ 1.25V MSI P55-GD65 Xpertvision Radeon HD4850 4GB G.Skill Ripjaw 
Hard DriveOptical DriveCoolingOS
150Gb Velociraptor & 1Tb WD Caviar Black Opticon Lightscribe DVD-RW DL Noctua NH-U12P SE2 Vista Home Premium x64 
MonitorKeyboardPowerCase
Hyundai BlueH H224W 22" LCD Saitek Eclipse II Thermaltake Purepower RX 550 Galaxy III 
Mouse
Patuoxun optical gaming mouse 3200dpi 
  hide details  
Reply
post #10 of 14
I must say this idea really intrigues me. Here's what I found from a quick google search:

http://www.computing.net/answers/win...down/6762.html

http://www.sevenforums.com/general-d...-shutdown.html

http://www.technologyquestions.com/t...-shutdown.html

Unfortunately I'm unable to boot into windows right now to check the location of the shutdown folder(link 3) or to test gpedit(link 1), but if it were me, I would probably write my own shutdown script as it talks about in link 2. If you do that, you could even set up a hotkey for your shutdown script. I don't know what version of windows you are using, but personally I miss the windows key+U+U shortcut to shutdown XP.
Watchtower
(13 items)
 
Amy
(10 items)
 
 
CPUMotherboardGraphicsRAM
Q6600 Asus Maximus II HD4870 and 8800GT 4GB Corsair Dominator 
OSMonitorPowerCase
64bit Windows 7 business n, Fedora 14, and Arch Asus 24", LG 22" AOC 19", and Compaq FS7600 600W SilverStone SST-SS60EF RocketFish 
Mouse
Logitech MX Air and Logitech V200 
CPUMotherboardGraphicsHard Drive
Intel Core i7-2630QM ASUSTek G73Sw GeForce GTX 460M Patriot Pyro SE 
Hard DriveOptical DriveOSOS
Segate ST9750420AS ATA Slimtype DVD A DS8A5SH ATA Arch Linux x86_64 Windows 7 Home Premium 64-bit SP1 
MonitorAudio
Generic PnP Monitor Realtek High Definition Audio 
  hide details  
Reply
Watchtower
(13 items)
 
Amy
(10 items)
 
 
CPUMotherboardGraphicsRAM
Q6600 Asus Maximus II HD4870 and 8800GT 4GB Corsair Dominator 
OSMonitorPowerCase
64bit Windows 7 business n, Fedora 14, and Arch Asus 24", LG 22" AOC 19", and Compaq FS7600 600W SilverStone SST-SS60EF RocketFish 
Mouse
Logitech MX Air and Logitech V200 
CPUMotherboardGraphicsHard Drive
Intel Core i7-2630QM ASUSTek G73Sw GeForce GTX 460M Patriot Pyro SE 
Hard DriveOptical DriveOSOS
Segate ST9750420AS ATA Slimtype DVD A DS8A5SH ATA Arch Linux x86_64 Windows 7 Home Premium 64-bit SP1 
MonitorAudio
Generic PnP Monitor Realtek High Definition Audio 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Windows
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Windows › Make program run at shutdown?