Real Geek Forums  

Go Back   Real Geek Forums > Archives > Operating Systems > Windows Vista > Windows Vista Administration

Notices

Reply

Can't display or change a task with schtasks.exe

 

LinkBack Thread Tools Display Modes
Old 08-03-2007, 06:16 PM   #1 (permalink)
Default Can't display or change a task with schtasks.exe

Hi, I want use schtasks.exe to interactively enable/disable a task that
executes at logoff (when run from a script file which will supply the yes/no
user prompt). The trouble I'm having is that the task I created in Task
Scheduler (named SleepAfterLogof) doesn't show up when I run schtasks.exe
/query at the command prompt.

The xml for the task (produced by the Export command in Task Schedular) is
pasted below. The purpose of the task is to automatically sleep the computer
after logoff. Note that the task is triggered by a specific system log event
(ID# 4647) and executes a script (which executes a program that tells the
computer to go to sleep). Also note that the task is set to run from the
SYSTEM account with highest priveledges (because the task has to keep
executing after I logoff).

Two interesting things to note: First, if I change the account under which
the task should run from SYSTEM to my own (which is in the admin group), I
get two errors when I run schtasks /query

ERROR: Task cannot be loaded: SleepAfterLogoff
ERROR: Access is denied.

Second: if I run schtasks in an elevated command prompt, the task
(SleepAfterLogoff) does appear and I can enable and disable it.

This looks like a security issue. There are a number of ways to think about
possible solutions, but basically I want to be able to enable/disable the
SleepAfterLogoff task using schtasks.exe from my account without resorting to
elevated priviledges (and without turning UAC off). There should be some way
(I hope) to tell the system that my account can have full access to the task.
Do tasks have ACL's? If so, can they be edited (i.e. as for files)? Thanks
in advance for help with this.

Clay


<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2"
xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2007-08-03T07:15:49.3280055</Date>
<Author>Drosera\Clay</Author>
<Description>Put the computer to sleep immediately after
logoff</Description>
</RegistrationInfo>
<Triggers>
<EventTrigger id="4057a03f-71f8-40ac-a708-90d1712d98c5">
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id="0" Path="Security"><Select
Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4647]]</Select></Query></QueryList></Subscription>
</EventTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<UserId>SYSTEM</UserId>
<RunLevel>HighestAvailable</RunLevel>
</Principal>
</Principals>
<Settings>
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>P3D</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>"E:\Development\Windows Script Host\Scripts\Run Drosera from
Trillium\Sleep Drosera.vbs"</Command>
</Exec>
</Actions>
</Task>
clayga
Guest
 
Posts: n/a
Reply With Quote  
Reply

Tags
None

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Display Setting Task mc Windows Vista Hardware & Devices 0 09-29-2006 05:36 PM
Programs Do Not Display In Task Bar Tom Windows XP WMI 1 06-23-2006 03:13 PM
schtasks problems Doug Windows XP Configuration & Management 1 07-26-2004 09:35 AM
TASK MANAGER DISPLAY WON'T STAY UP wILLIAM rOSEN Windows XP Basics 1 08-21-2003 05:54 PM
change the color of my task bar khumo phake Customize Windows XP 1 07-12-2003 05:13 PM


All times are GMT. The time now is 05:05 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright © 2005 - 2007 RealGeek.com. All rights reserved.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90