Win7 Scheduled Tasks

AlienWrangler

New member
Local time
2:06 AM
Messages
2
Starting to Deploy Win7Pro and found Task Scheduler different from XP.

We run a command that powers systems off at a specific time. The command will shut the system down when no user is logged in and gives a logged in user a pop up cancel window to abort if they're working.

I cannot seem get Win7 task scheduler to perform that same way.
Using account SYSTEM, it will shut the system down but not allow the interactive cancel window to pop up.
Using account USERS, it will only start the task if a user is logged in.

Any ideas of the right setting combination to get this to work?

Thanks
AlienWrangler
 

My Computer

OS
Windows 7 Prefessional
Are you scheduling the SHUTDOWN command?

Do a SHUTDOWN -? at a CMD prompt to see the options.

The COMPUTERNAME environment variable carries the name of the current machine.

-Noel
 

My Computer

Computer Manufacturer/Model Number
Dell Precision Workstation 490
OS
Windows 7 x64
CPU
2 x Dual Core Xeon 3.2 GHz
Motherboard
Dell
Memory
12 GB
Graphics Card(s)
ATI Radeon HD 4670
Sound Card
Onboard
Monitor(s) Displays
Dual Dell 20.1" LCD
Hard Drives
Dual 500 GB, Raid 0
PSU
Dell
Case
Dell
Cooling
Dell
are you using the "AT" command in your script to deploy the "shutdown" command?
 

My Computer

OS
7 Pro
I was using BeyondLogincs Beyond Logic Shutdown for NT/2000/XP Shutdown command because it give the user a clear interface to cancel and the timeout is adjustable.

I was using the AT command but the problem still occurs when I manually create the job from scratch.

Thanks
AlienWrangler
 

My Computer

OS
Windows 7 Prefessional
would you mind copying your script into a [.code][./code] window without the "."'s?
 

My Computer

OS
7 Pro
According to the documentation, a command with a user interface cannot be run using the "[ ] Run whether the user is logged in or not" option.

There is some pertinent info for your issue in the Task Security Context topic in the Scheduler help file... Specifically, it says, "...select the radio button labeled Run whether user is logged on or not. If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user is logged on radio button."

The intent here is apparently to never be able to put up the user interface from a program being run by one user on a session by another user.

I think you may be out of luck with that Beyond Logic software. The system SHUTDOWN command does put up warning prompts, but the user doesn't have the option of saying, "I'm here, don't shut down".

And you can set the Task Scheduler to only run the program if the computer has been idle.

Why are you shutting the computers down anyway? Some people like to run things overnight. I know I'd be miffed if I had set something up to finish and found my system had been forcibly shut down by IT. Also, the hardware will generally last longer if you leave it on and it stays hot (i.e., less temperature fluctuation, less chance for moisture accumulation).

-Noel
 

My Computer

Computer Manufacturer/Model Number
Dell Precision Workstation 490
OS
Windows 7 x64
CPU
2 x Dual Core Xeon 3.2 GHz
Motherboard
Dell
Memory
12 GB
Graphics Card(s)
ATI Radeon HD 4670
Sound Card
Onboard
Monitor(s) Displays
Dual Dell 20.1" LCD
Hard Drives
Dual 500 GB, Raid 0
PSU
Dell
Case
Dell
Cooling
Dell
Hi Wrangler, I've struggled with the same issue. What I came up with is two different VB scripts each scheduled with seperate tasks, but run at the same time.
The User version pops a window up asking to click ok to abort. If no one clicks after 5 minutes, the script runs shutdown.exe.
The non-user version checks to see if the explorer process is running. If so, then someone is logged in and the user script will kick in and the non-user script does nothing. If not, then no one is logged in and the user script won't run, so it shuts down the computer.

If you're interested, I can give more details.

Ethan
 

My Computer

OS
Windows 7 Enterprise x64
I just changed my home server from WHS to W7 and it works just fine for my neeeds. Now, I'm getting "Green" and would like to have the W7 "Server" go to sleep at a specific time and wake up at a specific time. I do not have the problem of a a user getting shutout since it is only my wife and I using the home network. If someone could give me the "stuff" I have to tell W7 Scheduler to accomplish this relatively straight forward feat I would appreciate it Thanks in advance.
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
Hi Ken429,
What you could do is create a batch file, maybe call it sleep.bat with this command in it:
rundll32 powrprof.dll,SetSuspendState
Then create a sheduled task to run this when you want the computer to go to sleep. This will put your computer to sleep only if hibernate is not enabled, so you may need to modify your power settings to disable hibernation.

To wake up again, create another batch file, maybe call it wake.bat. It doesn't matter the command you do, maybe just put "exit" as the only command, but when you create the scheduled task for it, make sure you check the box that says: "Wake the computer to run this task"

I hope that works for you!:D
Ethan
 

My Computer

OS
Windows 7 Enterprise x64
Nahte,
Thank you for the information. Looks simple and straight forward. I will give it a try. I also stumbled across a free utility called "WakeupOnStandby" which looks like it would do the job with a whole bunch of options that I don't think I want/need at this time.
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
Still struggling with the Auto Sleep and Auto Wakeup! Have been using WakeOnStandBy ver. 1.7.19 for several months and it works. But... I got cute and looked in the event log and saw that several errors were being posted each day and it looked like the program has some minor problems with W7. So I went to the Task Scheduler Sleep.bat and Wakeup.bat approach. It looked ok - all the event errors disappeared and I thought I was happy. However, for some reason the system goes back to Sleep on its own after about 5 minutes. The Message in the Event Log says "Kernel-Power 42(64) Sleep Reason: System Idle."

The Sleep.bat file has one entry - "rundll32 powrprof.dll,SetSuspendState" and the WakeUp.bat file also has one one entry - "exit". I selected W7 in the Task Scheduler and I checked the Wake From Sleep for the WakeUp task. If I hit the power button after the unscheduled Sleep the system stays on until the task to put to sleep is run in the evening! I am using an APC XS 1500 UPS am using the default W7 UPS service to handle the UPS. Any clues on what I'm missing?
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
If anybody cares, I installed the latest version of APC's PowerChute Personal Edition to replace the built-in W7 UPS manager and my problem went away! So much for keeping it simple.
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
All was working well using the "exit" command in a "Wake.bat" file. However, I put W7 "Server" on a faster machine with a SSD for the boot drive. Now the Wake.bat does not work! Task Scheduler says it ran it ok but the system does not wake up. If I change the Wake.bat to add a second line with "exit" it works?! Any idea on what the heck is going on? I also tried putting a pause before exit and that also worked excepted Task Scheduler said the task was still running - which makes sense. One more question - the monitor stays in "sleep" mode until I hit the keyboard or move the mouse. I don't remember if that was the way it worked originally or is something else going on?
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
Well, I moved the "Wake.bat" file to the SSD boot drive and it works with just one "exit" command. So...it would appear that the SSD drive wakes up a lot faster than a standard 10,000 rpm Raptor and that is what is/was causing the Wake.bat to not work correctly!?
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
The story goes on - now that I have the Wake.bat on the SSD Task Scheduler will wake the computer after it has been "Sleeping" for a few minutes. That always seems to work. However, when the system has been sleeping for several hours (10PM - 4AM) the Wakeup Task says it completed ok but the computer never wakes up. Is there some setting in the Power Options that I should be looking at? Help is needed and would be appreciated.
 

My Computer

OS
Windows 7 Home Premium 64-bit
CPU
2600K
Motherboard
Asus P8Z68-V pro
Memory
8 GB Corsair Vengence C8
Graphics Card(s)
MSI 560 TI
Sound Card
Intel on MB
Monitor(s) Displays
Samsung 2433
Screen Resolution
1920X1080
Hard Drives
120 GB Mushkin Deluxe SATA III SSD
2 - WD 300 GB Raptors
PSU
SeaSonic X850
Case
Corsair 600T
Cooling
Corsair H60
Keyboard
Logitech Wireless
Mouse
Logitech Wireless
Internet Speed
Cable
Back
Top