ERROR CODE ON SCHEDULED TASK

  • Thread starter Thread starter HankL
  • Start date Start date
H

HankL

I am receiving the following error code under column LAST RUN RESULT (0X1)

When I use an Attribute that has a single word, i.e. Paperport, I set it up as space -RPaperport and it works just fine. The final result is (0x0) successful
When I use an Attribute that has two single words with a space between them, I set it up as "space-Special Sites" and the final result is (0x1) and is not successful
 
HankL said:
I am receiving the following error code under column LAST RUN RESULT (0X1)

When I use an Attribute that has a single word, i.e. Paperport, I set it up as space -RPaperport and it works just fine. The final result is (0x0) successful
When I use an Attribute that has two single words with a space between them, I set it up as "space-Special Sites" and the final result is (0x1) and is not successful

Is "attribute" what the rest of us call command-line parameters? Rather
than describe just a tiny portion of the entire event defined in Task
Scheduler, show more details, like the *complete* command that you pass
in the event (i.e., what it runs) for when the event runs okay and when
it fails. I'm guessing that you aren't properly employing double quotes
to delimit the command or you are including them around the parameters
(which means you are passing one parameter, not two, and that the
program aborts because it is then an undefined parameter).

After defining the event for when it generates the failure code, what
happens if you copy the *entire* command line for the event and run it
in a command prompt? If the program's executable isn't available via
the currently defined PATH environment variable, you will need to 'cd'
to the directory where the executable is located. The same is true in
the event's definition: if the executable isn't in the PATH, you need to
either specify the full path to the executable or specify the executable
file's path in the start-in field for the event.

Did you look at Task Scheduler's log (advanced menu)? It rolls over so
you have to find where is the "[ ***** Most recent entry is above this
line ***** ]" delimiter line showing the rollover point and look at the
events above that line.
 
Thank you very much for your reply.

In answer to your questions,

1) Is "attribute" what the rest of us call command-line parameters? Answer 'Arguments'

2) *complete* command that you pass> in the event This is a typical line and format that received the error message (0x1)Answer "C:\Program Files (x86)\SyncToy2.0\SynctoyCmd.exe" -R"Garage My Pictures"

3) Event that ran OK Answer "C:\Program Files (x86)\SyncToy2.0\SyncToyCmd.exe" -Quicken

4) After defining the event for when it generates the failure code, what
happens if you copy the *entire* command line for the event and run it
in a command prompt? If the program's executable isn't available via
the currently defined PATH environment variable, you will need to 'cd'
to the directory where the executable is located. Answer 'I attempted to run the line in CMD as shown above in answer 2) and it did not execute'

5) you will need to 'cd' DO NOT UNDERSTAND WHAT YOU MEAN BY 'CD'
to the directory where the executable is located. The same is true in
the event's definition: if the executable isn't in the PATH, you need to
either specify the full path to the executable or specify the executable
file's path in the start-in field for the event.

6) Did you look at Task Scheduler's log (advanced menu)? Answer I could not locate the Task Scheduler's Log (advanced menu)

Just as a bit of information, I am fairly new at using Scheduled Task and would really appreciate your indulgence with that in mind. If could you be just a little bit more specific with your instructions in a more detailed manner I feel I could follow your instructions and hopefully get my scheduled items to work properly. I have a total of16 schedules that need to work. Two are working and 14 or not.Yet I feel I used the same actions in all but only changed the 'Arguments' as it related to each schedule task.

Again, many thanks for taking your time to assist and give me support.

HankL



VanguardLH said:
HankL said:
I am receiving the following error code under column LAST RUN RESULT (0X1)

When I use an Attribute that has a single word, i.e. Paperport, I set it up as space -RPaperport and it works just fine. The final result is (0x0) successful
When I use an Attribute that has two single words with a space between them, I set it up as "space-Special Sites" and the final result is (0x1) and is not successful

Is "attribute" what the rest of us call command-line parameters? Rather
than describe just a tiny portion of the entire event defined in Task
Scheduler, show more details, like the *complete* command that you pass
in the event (i.e., what it runs) for when the event runs okay and when
it fails. I'm guessing that you aren't properly employing double quotes
to delimit the command or you are including them around the parameters
(which means you are passing one parameter, not two, and that the
program aborts because it is then an undefined parameter).

After defining the event for when it generates the failure code, what
happens if you copy the *entire* command line for the event and run it
in a command prompt? If the program's executable isn't available via
the currently defined PATH environment variable, you will need to 'cd'
to the directory where the executable is located. The same is true in
the event's definition: if the executable isn't in the PATH, you need to
either specify the full path to the executable or specify the executable
file's path in the start-in field for the event.

Did you look at Task Scheduler's log (advanced menu)? It rolls over so
you have to find where is the "[ ***** Most recent entry is above this
line ***** ]" delimiter line showing the rollover point and look at the
events above that line.
 
Hankl, STOP POSTING IN HTML! When posting in newsgroups, always use
plain text. Configure Windows Mail to use text when posting to
newsgroups.
In answer to your questions,

1) Is "attribute" what the rest of us call command-line parameters?
Answer: 'Arguments'

2) *complete* command that you pass in the event
This is a typical line and format that received the error message
(0x1)
Answer: "C:\Program Files (x86)\SyncToy2.0\SynctoyCmd.exe"
-R"Garage My Pictures"

3) Event that ran OK
Answer: "C:\Program Files (x86)\SyncToy2.0\SyncToyCmd.exe" -Quicken

So the problem is SyncToy fails when you attempt to specify the folder
pair that you want it to synchronize. Did you ever define that folder
pairing (named "Garage My Pictures") in SyncToy? Does SyncToy complete
the synchronization okay when you run SyncToy and do the update using
its UI?

I only meant to address how to solve problems in Task Scheduler. It has
been several years since I toyed with SyncToy. If you need help with
that program then start a new thread about SyncToy and using
command-line parameters (arguments) for it. From playing with SyncToy
years ago, my recollection is that you have to define folder pairings
(i.e., what you wanted to synchronize). It is those names for those
pairings that you probably need to specify for the -R parameter.

From http://www.itechtalk.com/member687-albums555-5671.png, it looks
like you have to use the History tab (when looking at the properties of
an event) and then review Details tab to find out what happened.
4) After defining the event for when it generates the failure code,
what happens if you copy the *entire* command line for the event and
run it in a command prompt? If the program's executable isn't
available via the currently defined PATH environment variable, you
will need to 'cd' to the directory where the executable is located.
Answer: I attempted to run the line in CMD as shown above in answer 2)
and it did not execute'

If the command fails at a command prompt then it will also fail when ran
by a scheduled event. The command must first work when executed by
itself for it to also work as a scheduled event.
5) you will need to 'cd'
DO NOT UNDERSTAND WHAT YOU MEAN BY 'CD'

'cd' is the change directory command at a DOS prompt (i.e., when you are
at a command prompt). If the path to an executable isn't found by using
the PATH environment variable (or through a registry value) then you
will get an error of "not found" or "not defined" when you try to
execute the unknown program. If not in the PATH (or registry), you need
to 'cd' to the directory where the executable file resides and then
enter your command. However, as you pointed out above, you do know the
full path to the executable file.
6) Did you look at Task Scheduler's log (advanced menu)?
Answer I could not locate the Task Scheduler's Log (advanced menu)

I'm still using Windows XP but assumed that Task Scheduler in Windows
Vista still lets users see its logfile. There is no Advanced menu?
From the images for the link above, yep, Microsoft altered the UI for
Task Scheduler but the log (history) is still available.

That image was taken from the following online help guide and which
addresses how to use Task Scheduler under Windows Vista:

http://www.windowsvistauserguide.com/task_scheduler.htm
Two are working and 14 or not.Yet
I feel I used the same actions in all but only changed the
'Arguments' as it related to each schedule task.

To reiterate, the command must first work at a command prompt before you
can specify it in a scheduled event. From the above comments, the
program failed when you ran it from the command line, so it also fail
when loaded by a scheduled event.
 
MS and Parsing

Hi All,

Microsoft's Task Scheduler cannot parse quotation marks (") in the command line parameters of scheduled tasks. So:

C:\batch.cmd C:\Log_File.txt
will succeed, but

C:\batch.cmd "C:\Log File.txt"
will fail and return error code 0x1.

Here is the MS article regarding this issue: http://support.microsoft.com/kb/951246 It applies to Vista and Server 2008 but I have found the same issue in XP as well. I had a batch file that would run fine from the command prompt but fail in task scheduler. I was sure the account info was right. I finally found this article and removed the quotation marks and it worked like a charm. As you have already seen above, you can replace spaces in arguments with underscores (_) when you remove the quotation marks.

I saw this issue on the interwebs a lot, so I wanted to make sure this solution was posted.

Hope this helps!
 
Back
Top