<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" &gt;"%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><div>Thanks a lot,<br><br>Cedric<br></div><div><br><br><div><br><br></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/11/23 Cedric Frayssinet <span dir="ltr"><<a href="mailto:cedric.frayssinet@gmail.com" target="_blank">cedric.frayssinet@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p dir="ltr"><br>
Le 23 nov. 2013 22:51, "Stefan Pendl" <<a href="mailto:stefan.pendl.71@gmail.com" target="_blank">stefan.pendl.71@gmail.com</a>> a écrit :</p><div><div class="h5"><br>
><br>
> Am 23.11.2013 22:31, schrieb Cedric Frayssinet:<br>
><br>
>><br>
>> Yes but 4000 computers have been already installed :/<br>
>> I'd like to make that with wpkg...<br>
>><br>
>><br>
><br>
> Here is an example package, you need to change the time and the name of the schedule frequency to match your locale.<br>
><br>
> -- <br>
> '---code start (watch for line wraps)<br>
><br>
> <package<br>
>         id="ShutdownComputer"<br>
>         name="JH Shutdown Computer"<br>
>         revision="2011.10.27"<br>
>         reboot="false"<br>
>         priority="900"><br>
><br>
>     <depends package-id="RebootShutdownCMD" /><br>
><br>
>     <variable name="PKG_TIME_S" value="22:00:00"/><br>
>     <variable name="PKG_TIME_S" value="22:05:00" hostname="^AV.+"/><br>
>     <variable name="PKG_TIME_S" value="22:10:00" hostname="^CAD.+"/><br>
>     <variable name="PKG_TIME_S" value="22:15:00" hostname="^CAM.+"/><br>
>     <variable name="PKG_TIME_S" value="22:20:00" hostname="^E.+"/><br>
>     <variable name="PKG_TIME_S" value="22:25:00" hostname="^[GHI].+"/><br>
>     <variable name="PKG_TIME_S" value="22:30:00" hostname="^KST3.+"/><br>
>     <variable name="PKG_TIME_S" value="22:35:00" hostname="^KST4[0-2].+"/><br>
>     <variable name="PKG_TIME_S" value="22:40:00" hostname="^KST4[3-6].+"/><br>
>     <variable name="PKG_TIME_S" value="22:45:00" hostname="^KST[56].+"/><br>
>     <variable name="PKG_TIME_S" value="22:50:00" hostname="^[L-Q].+"/><br>
>     <variable name="PKG_TIME_S" value="22:55:00" hostname="^[R-V].+"/><br>
>     <variable name="PKG_EXE"    value="shutdown -s -t 600"/><br>
><br>
>     <!-- english variables --><br>
>     <variable name="PKG_SCHEDULE" value ="WEEKLY" /><br>
>     <variable name="PKG_DAYS"     value ="MON,TUE,THU,FRI,SAT,SUN" /><br>
><br>
>     <!-- german variables --><br>
>     <variable name="PKG_SCHEDULE" value ="WÖCHENTLICH"       lcid="407,c07,1407,1007,807" /><br>
>     <variable name="PKG_DAYS"     value ="MO,DI,DO,FR,SA,SO" lcid="407,c07,1407,1007,807" /><br>
><br>
>     <!-- Server 2003 english --><br>
>     <variable name="PKG_SCHEDULE" value ="WEEKLY"                  os="server" lcidOS="409"/><br>
>     <variable name="PKG_DAYS"     value ="MON,TUE,THU,FRI,SAT,SUN" os="server" lcidOS="409"/><br>
><br>
>     <variable name="PKG_TASK_NAME" value ="JH_Shutdown_Computer" /><br>
><br>
>     <check type="file"    condition="exists"          path="%SystemRoot%\Tasks\%PKG_TASK_NAME%.job"              os="5\.\d\.\d{4}"/><br>
>     <check type="execute" condition="exitcodeequalto" path='SCHTASKS /Query /NH /TN "%PKG_TASK_NAME%"' value="0" os="6\.\d\.\d{4}"/><br>
><br>
>     <install include="remove" /><br>
>     <install cmd='%ComSpec% /c schtasks /create /tn "%PKG_TASK_NAME%" /tr "\"%PKG_EXE%\"" /sc %PKG_SCHEDULE% /d "%PKG_DAYS%" /st "%PKG_TIME_S%" /ru "SYSTEM" &gt;"%TMP%\%PKG_TASK_NAME%.log"' /><br>


><br>
>     <upgrade include="install" /><br>
><br>
>     <remove cmd='SCHTASKS /Delete /TN "%PKG_TASK_NAME%" /F' ><br>
>         <exit code="1"/><br>
>     </remove><br>
> </package><br>
><br>
> '---code end<br>
><br>
></div></div><p></p>
<p dir="ltr">Thanks a lot Stefan ! I will study it next week :)</p><span class="HOEnZb"><font color="#888888">
<p dir="ltr">Cedric<br><br><br><br></p></font></span><div class="HOEnZb"><div class="h5">
<p dir="ltr">> --<br>
> Stefan P.<br>
><br>
> Top-posting:<br>
> A: Because it messes up the order in which people normally read text.<br>
> Q: Why is top-posting such a bad thing?<br>
> A: Top-posting.<br>
> Q: What is the most annoying thing in e-mail?<br>
><br>
> -------------------------------------------------------------------------<br>
> Hotel discounts, best prices: <a href="http://www.booking.com/index.html?aid=366545" target="_blank">http://www.booking.com/index.html?aid=366545</a><br>
> -------------------------------------------------------------------------<br>
> wpkg-users mailing list archives >> <a href="http://lists.wpkg.org/pipermail/wpkg-users/" target="_blank">http://lists.wpkg.org/pipermail/wpkg-users/</a><br>
> _______________________________________________<br>
> wpkg-users mailing list<br>
> <a href="mailto:wpkg-users@lists.wpkg.org" target="_blank">wpkg-users@lists.wpkg.org</a><br>
> <a href="http://lists.wpkg.org/mailman/listinfo/wpkg-users" target="_blank">http://lists.wpkg.org/mailman/listinfo/wpkg-users</a><br>
</p>
</div></div></blockquote></div><br></div>