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

Vista Task Scheduler can't run OK *.BAT file

microsoft.public.windows.vista.administration accounts passwords






Speedup My PC
Reply
  #1 (permalink)  
Old 07-15-2007
Ron A. Zajac
 

Posts: n/a
Vista Task Scheduler can't run OK *.BAT file
Pretty straight up situation.

I have a batch file:

"C:\TclStuff\Batch Files\PlaySomething.bat" Annie

This runs on a command line just fine. It won't run from the Task Scheduler:

Task Scheduler failed to start instance
"{DA573AEA-805C-4477-8152-53B595EF95C9}" of "\Wake for Annie" task for user
"a-PC\Ron A. Zajac" . Additional Data: Error Value: 2147942667.

What gives?


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-15-2007
Ronnie Vernon MVP
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file
Ron

In the Task Scheduler for this task, do you have the "Run with highest
privileges" option enabled in the General Tab?

--

Ronnie Vernon
Microsoft MVP
Windows Shell/User


"Ron A. Zajac" <Ron A. Zajac@discussions.microsoft.com> wrote in message
news:9092888C-2D17-417C-B3E6-E87D5034B8DE@microsoft.com...
> Pretty straight up situation.
>
> I have a batch file:
>
> "C:\TclStuff\Batch Files\PlaySomething.bat" Annie
>
> This runs on a command line just fine. It won't run from the Task
> Scheduler:
>
> Task Scheduler failed to start instance
> "{DA573AEA-805C-4477-8152-53B595EF95C9}" of "\Wake for Annie" task for
> user
> "a-PC\Ron A. Zajac" . Additional Data: Error Value: 2147942667.
>
> What gives?
>
>


Reply With Quote
  #3 (permalink)  
Old 07-16-2007
Ron A. Zajac
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file
Ronnie,

Thanks for the suggestion.

No, this option wasn't enabled. I enabled it, then issued a "Run" order
again to test it. It didn't work. Here's the formatted ("friendly") Details
ouput:

- System

- Provider

[ Name] Microsoft-Windows-TaskScheduler
[ Guid] {de7b24ea-73c8-4a09-985d-5bdadcfa9017}

EventID 203

Version 0

Level 2

Task 203

Opcode 101

Keywords 0x8000000000000000

- TimeCreated

[ SystemTime] 2007-07-16T10:56:30.270Z

EventRecordID 2891

- Correlation

[ ActivityID] {E60BD601-7B36-4973-9586-316BC088C6A9}

- Execution

[ ProcessID] 4916
[ ThreadID] 7592

Channel Microsoft-Windows-TaskScheduler/Operational

Computer a-PC

- Security

[ UserID] S-1-5-21-1865275644-502863341-2745678560-1001


- EventData

TaskName \Wake for Annie
TaskInstanceId {E60BD601-7B36-4973-9586-316BC088C6A9}
ActionName C:\Windows\SYSTEM32\cmd.exe
ResultCode 2147942667


I could mention the fact that the *.BAT has a header that runs another
interpreter (tclsh). However, I feel this is likely a non-issue; if I can
run it from a command line, why shouldn't the Scheduler be able to run it?
On the off-chance it had something to do with the $path$, I quickly modified
that header to invoke the tclsh using the full path (c:\Tcl\bin\tclsh); no
dice.

Again, thanks for your kind ministrations! If another angle occurs to
you, please keep me posted!

-raz (Ron A. Zajac)

"Ronnie Vernon MVP" wrote:

> Ron
>
> In the Task Scheduler for this task, do you have the "Run with highest
> privileges" option enabled in the General Tab?
>
> --
>
> Ronnie Vernon
> Microsoft MVP
> Windows Shell/User
>
>
> "Ron A. Zajac" <Ron A. Zajac@discussions.microsoft.com> wrote in message
> news:9092888C-2D17-417C-B3E6-E87D5034B8DE@microsoft.com...
> > Pretty straight up situation.
> >
> > I have a batch file:
> >
> > "C:\TclStuff\Batch Files\PlaySomething.bat" Annie
> >
> > This runs on a command line just fine. It won't run from the Task
> > Scheduler:
> >
> > Task Scheduler failed to start instance
> > "{DA573AEA-805C-4477-8152-53B595EF95C9}" of "\Wake for Annie" task for
> > user
> > "a-PC\Ron A. Zajac" . Additional Data: Error Value: 2147942667.
> >
> > What gives?
> >
> >

>

Reply With Quote
  #4 (permalink)  
Old 07-16-2007
Jimmy Brush
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file
<snip>
> TaskName \Wake for Annie
> TaskInstanceId {E60BD601-7B36-4973-9586-316BC088C6A9}
> ActionName C:\Windows\SYSTEM32\cmd.exe
> ResultCode 2147942667

</snip>

Hello,

If it helps at all, that result code translates into this Win32 error code:

Error # 267 (ERROR_DIRECTORY)
The directory name is invalid.

- JB

Reply With Quote
  #5 (permalink)  
Old 07-16-2007
Ron A. Zajac
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file
Jimmy,

I guess that tell me something: You're saying that the cmd.exe is
returning that error code? It still raises the question: Why would the
manual run of the script go OK, whereas running it under the auspices of the
Task Scheduler results in some kind of a directory path-related offense
against the cmd.exe? Shouldn't the Task Scheduler--running "as" me--have the
same environment as I do?

Oh: And a sincere thanks for your interest!

-raz

"Jimmy Brush" wrote:

> <snip>
> > TaskName \Wake for Annie
> > TaskInstanceId {E60BD601-7B36-4973-9586-316BC088C6A9}
> > ActionName C:\Windows\SYSTEM32\cmd.exe
> > ResultCode 2147942667

> </snip>
>
> Hello,
>
> If it helps at all, that result code translates into this Win32 error code:
>
> Error # 267 (ERROR_DIRECTORY)
> The directory name is invalid.
>
> - JB
>
>

Reply With Quote
  #6 (permalink)  
Old 07-17-2007
Jimmy Brush
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file
Ron A. Zajac wrote:
> Jimmy,
>
> I guess that tell me something: You're saying that the cmd.exe is
> returning that error code? It still raises the question: Why would the
> manual run of the script go OK, whereas running it under the auspices of the
> Task Scheduler results in some kind of a directory path-related offense
> against the cmd.exe? Shouldn't the Task Scheduler--running "as" me--have the
> same environment as I do?
>
> Oh: And a sincere thanks for your interest!
>


I'm not really sure.

Is your account an administrator account, or do you run as a standard
user and elevate to a seperate admin account?

Can you export your task to an xml file and then post the contents of
that file so we can have a look?

- JB
Reply With Quote
  #7 (permalink)  
Old 07-31-2007
hexago@gmail.com
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file
On Jul 16, 10:37 am, Jimmy Brush <j...@mvps.org> wrote:
> <snip>> TaskName \Wake for Annie
> > TaskInstanceId {E60BD601-7B36-4973-9586-316BC088C6A9}
> > ActionName C:\Windows\SYSTEM32\cmd.exe
> > ResultCode2147942667

>
> </snip>
>
> Hello,
>
> If it helps at all, that result code translates into this Win32errorcode:
>
> Error# 267 (ERROR_DIRECTORY)
> The directory name is invalid.
>
> - JB


I had the same problem. I had to remove the quotation marks in the
Start in field.

Changed from "C.\Program Files\" to C.\Program Files\

Reply With Quote
  #8 (permalink)  
Old 09-17-2008
Jorge Luis's Avatar  

Join Date: Sep 2008
Posts: 1
Jorge Luis is on a distinguished road
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
I had the same problem. I had to remove the quotation marks in the
Start in field.

Changed from "C.\Program Files\" to C.\Program Files\
This worked for me, thank you very much!!!

If you are just wondering like me... quotation marks are needed for the name of the file you want to be executed but not for the directory to 'Start in'.

Greetings!

Jorge Luis
Reply With Quote
  #9 (permalink)  
Old 09-25-2009
jjman
 

Posts: n/a
Re: Vista Task Scheduler can't run OK *.BAT file

Brilliant! hexago@gmail.com you save me from more hours of pulling my
hair out.



--
jjman
Reply With Quote
Reply


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
Task Scheduler: Repeat Task and Duration kirsch59 microsoft.public.windows.vista.general 6 07-11-2007 22:01
Task scheduler problem : task do not close Junkyard Engineer microsoft.public.windows.vista.general 0 06-07-2007 02:51
Vista Task Scheduler gordo999@isp.com microsoft.public.windows.vista.general 5 05-09-2007 14:44
Task Scheduler keeps crashing (Vista) Lord Deathknight microsoft.public.windows.vista.general 0 05-02-2007 02:19




All times are GMT +1. The time now is 19:05.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
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