Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download

Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

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

Speedup My PC
  #1 (permalink)  
Old 08-03-2007

Posts: n/a
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.


<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2"
<Description>Put the computer to sleep immediately after
<EventTrigger id="4057a03f-71f8-40ac-a708-90d1712d98c5">
<Subscription><QueryList><Query Id="0" Path="Security"><Select
Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4647]]</Select></Query></QueryList></Subscription>
<Principal id="Author">
<Actions Context="Author">
<Command>"E:\Development\Windows Script Host\Scripts\Run Drosera from
Trillium\Sleep Drosera.vbs"</Command>
Reply With Quote
Sponsored Links

Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
change a display picture? darkmagic2 pictures video 1 07-12-2007 14:25
Change primary display =?Utf-8?B?R2lhbiBNYXJpYS4=?= hardware devices 0 03-28-2007 03:01
schtasks Does Not Run It When The Path of the Task Contains a Spac =?Utf-8?B?SXNlZVZpc3Rh?= 1 03-28-2007 01:49
Creating a Schedule Task in Vista with schtasks, Getting Access De =?Utf-8?B?S2FybFtVU10=?= 0 02-20-2007 23:44
Display Settings change =?Utf-8?B?d29zdWxseQ==?= pictures video 0 01-14-2007 14:40

All times are GMT +1. The time now is 14:59.

Driver Scanner - Free Scan Now is part of the Heads Network. See also , and

Design by Vjacheslav Trushkin for
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120