<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 02.12.2013 13:42, schrieb Cedric
Frayssinet:<br>
</div>
<blockquote
cite="mid:CALaMdAOnZv1_doOSjmSNdLmbCqBY2fkBdfY-Oh9D9UcbmXD_9Q@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>Hi,<br>
<br>
</div>
I used your package Stefan like this :<br>
<br>
<div class="">
<pre class=""><code><package
id="PowerOff-7"
name="Extinction des postes Seven a heure fixe"
revision="2013.11.24"
reboot="false"
priority="900">
<!-- definition de l'heure d'extinction -->
<variable name="PKG_TIME_S" value="19:00:00"/>
<!-- 120 est le temps en secondes au bout duquel Windows se ferme -->
<variable name="PKG_EXE" value="shutdown -s -t 120"/>
<!-- variables concernant l'execution de la tache -->
<!-- on eteint les postes tous les jours -->
<variable name="PKG_SCHEDULE" value ="DAILY" />
<!-- on donne un nom de tache -->
<variable name="PKG_TASK_NAME" value ="Extinction_Postes_7" />
<check type="execute" condition="exitcodeequalto" path='SCHTASKS /Query /NH /TN "%PKG_TASK_NAME%"' value="0" os="6\.\d\.\d{4}"/>
<install os=".+6\.[0-1]\.\d{4}" timeout="300" include="remove" />
<install os=".+6\.[0-1]\.\d{4}" timeout="300" cmd='%ComSpec% /c schtasks /create /tn "%PKG_TASK_NAME%" /tr "\"%PKG_EXE%\"" /sc %PKG_SCHEDULE% /st "%PKG_TIME_S%" /ru "SYSTEM" >"%TMP%\%PKG_TASK_NAME%.log"' />
<upgrade include="install" />
<downgrade include="install" />
<remove os=".+6\.[0-1]\.\d{4}" timeout="300" cmd='SCHTASKS /Delete /TN "%PKG_TASK_NAME%" /F' ><exit code="1"/></remove>
</package></code></pre>
</div>
<br>
</div>
Scheduled task is ok on computers (attached file). But there
is 2 errors on execute :<br>
<br>
</div>
- <span id="result_box" class="" lang="en"><span class="">failure</span>
<span class="">to start the action (error code : 2147942402)<br>
</span></span>
<div>- failure to execute (same error code)<br>
<br>
</div>
<div>Do you know how to resolve this problem ?<br>
<br>
</div>
<br>
</div>
</blockquote>
Sorry, I forgot to clean up the line with the command.<br>
<br>
The two backslashes and the double quotes must be removed as shown
below.<br>
<br>
You can check this if you take a look at the command line of the
scheduled task in the task database.<br>
<pre class="moz-signature" cols="72">
'---code start (watch for line wraps)
<code>/tr "%PKG_EXE%"
</code>'---code end
--
Stefan P.
Top-posting:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?</pre>
</body>
</html>