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? - Page 2

post #11 of 14
Thread Starter 
It appears that the Shutdown folder is for Xp only. Running gpedit.msc on windows 7 doesn't work for me. I've done some research, and this is a VBS script that I wrote that would work.

Code:
Dim var
Set var = WScript.CreateObject ("WScript.Shell")
var.run "shutdown -a"
Set var = Nothing
returnvalue=MsgBox("Are you sure that you want to shutdown? A backup is running",292,"Please Don't shut down!!!")
If returnvalue = 6 Then
Set var = WScript.CreateObject ("WScript.Shell")
var.run "shutdown -s -t 60"
Set var1 = Nothing
Else If returnvalue = 7 Then
MsgBox"The Shutdown Has Been Canceled"
End If End If
I haven't shutdown the computer with it, but I know it works. I just put a 1 minute timer so it didn't fully shutdown. Also, because It doesn't run at shutdown, I am not sure if it will go into a shutdown loop, continuously running this program when the person choses to shut down.

So all I really need to know is how to get it to run at shutdown.
Edited by Jtvd78 - 6/1/11 at 5:45pm
post #12 of 14
I fear that might be a question for MSDN, rather than here (you might get lucky though!)
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 #13 of 14
Yeah I ended up writing a powershell script to run a shutdown on my windows 7 machine and I know that it works but every time I shutdown the script either did not run due to a misconfig or windows shut down so fast that it never got a chance to run.

are you experiencing something similar?
post #14 of 14
Thread Starter 
I am just having a problem getting it to run at shutdown in the first place. I tried using task scheduler, but nothing happenned.
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?