Task Scheduler error code 5 with .bat

Hello, I created a Task to execute a batch file and I get en error code 5 after the execution.
I have a WS2008 R2 64 bits
When I just clic on the batch file, it execute fine, but when I program a task it doesn't execute.
Here is the batch :

@echo off
cd /d E:\HTMLTOOLS\
htmltools.exe -webkit "http://www.skiplan.pro/web/bulletin/bulletin.php?station=sybelles®ion=alpes&pays=france&lang=fr" E:\docv8\lad\SKIPLAN\multi\Sybelles.pdf
exit

Here is the Result from the event log in XML :

Nom du journal :Microsoft-Windows-TaskScheduler/Operational
Source :       Microsoft-Windows-TaskScheduler
Date :         26/11/2013 18:49:26
ID de l’événement :201
Catégorie de la tâche :Action terminée
Niveau :       Information
Mots clés :    
Utilisateur :  MMP\rexrotary
Ordinateur :   SRVBUCO3.mmp.local
Description :
Le Planificateur de tâches a terminé la tâche « \HTMLTOOLS », instance « {c2cd0bd3-0612-4c49-9981-132d56883394} », action « C:\Windows\SYSTEM32\cmd.exe » avec le code de retour 5.
XML de l’événement :
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-TaskScheduler" Guid="{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}" />
    <EventID>201</EventID>
    <Version>1</Version>
    <Level>4</Level>
    <Task>201</Task>
    <Opcode>2</Opcode>
    <Keywords>0x8000000000000000</Keywords>
    <TimeCreated SystemTime="2013-11-26T17:49:26.799517500Z" />
    <EventRecordID>74928</EventRecordID>
    <Correlation ActivityID="{C2CD0BD3-0612-4C49-9981-132D56883394}" />
    <Execution ProcessID="5292" ThreadID="4076" />
    <Channel>Microsoft-Windows-TaskScheduler/Operational</Channel>
    <Computer>SRVBUCO3.mmp.local</Computer>
    <Security UserID="S-1-5-21-2231089222-1738138904-3927364064-1837" />
  </System>
  <EventData Name="ActionSuccess">
    <Data Name="TaskName">\HTMLTOOLS</Data>
    <Data Name="TaskInstanceId">{C2CD0BD3-0612-4C49-9981-132D56883394}</Data>
    <Data Name="ActionName">C:\Windows\SYSTEM32\cmd.exe</Data>
    <Data Name="ResultCode">5</Data>
  </EventData>
</Event>

Could you help me, I searched for all day but I couldn't fix it
Tanks
mdmmpAsked:
Who is Participating?
 
brendanmeyerConnect With a Mentor Commented:
try, setting it to run only when the user is logged on , log on as that user. and run the task, check if it works

if its still the batch file,
put pause instead of exit so you and see the output

other than that, i am running out of things that it could be
0
 
brendanmeyerCommented:
change the action of the task to the the path of the batch file as in the image below instead of cmd.exe (looks like it has been blocked for security purposes)

image
0
 
mdmmpAuthor Commented:
Hello,I tried this, but the task never end.
ImageThe lines are :
Program : C:\Windows\SYSTEM32\cmd
Arguments : htmltools.exe -webkit "http://www.skiplan.pro/web/bulletin/bulletin.php?station=sybelles®ion=alpes&pays=france&lang=fr" E:\docv8\lad\SKIPLAN\multi\Sybelles.pdf exit
Start in  : E:\HTMLTOOLS\

I also tried this :
ImageBut there is still the same error

Here is the rest of the task :
Image
Tanks
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
brendanmeyerCommented:
are the arguments : htmltools.EXE or htmltools.CMD ?
is that incorrect?
0
 
mdmmpAuthor Commented:
the executable of the application is htmltools.exe
and my .bat file is htmltools.cmd

image
0
 
brendanmeyerCommented:
is e: a local or shared?

try having a look in the event log for any logs relating to the scheduled task
0
 
mdmmpAuthor Commented:
E: is a local hard drive
I attached the log files in csv format and txt format
Event.txt
Event.csv
0
 
brendanmeyerCommented:
try creating the task with

program: E:\HTMLTOOLS\htmltools.exe

arguments: -webkit "http://www.skiplan.pro/web/bulletin/bulletin.php?station=sybelles®ion=alpes&pays=france&lang=fr" E:\docv8\lad\SKIPLAN\multi\Sybelles.pdf

program: E:\HTMLTOOLS\
0
 
mdmmpAuthor Commented:
I have still the same error, here are the screenshot and the Csv file
12Event-Task-1.csv
0
 
mdmmpAuthor Commented:
It works with the user login
And when it open the DOS Windows, I could see that the product is not registered for this user !
So I have toregister the htmltools.exe for the user I run the task on.
Tanks for help, I could fin out what was going on
0
 
mdmmpAuthor Commented:
It help me to fin what the problem was
0
 
brendanmeyerCommented:
Glad I could have been some help
0
All Courses

From novice to tech pro — start learning today.