<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1">Windows 7 (and windows XP) : a method to run wpkg at
shutdown<br>
<br>
<br>
(sorry for my basic english…)<br>
<br>
Firstly, the actual option “run at system shutdown” of wpkg
client is not compatible with windows 7.<br>
<br>
Secondly, windows 7 systematically kills wpkg service after 10
minutes.<br>
<br>
My solution : i don’t use wpkg service, i call directly wpkg.js
with a simple script at shutdown !<br>
Explanation of method in 5 steps :<br>
<br>
*** Step 1 *** (increase to 30 minutes the “gpo script timeout”)<br>
with gpo : Computer Configuration \ Administrative Templates \
System \ Scripts<br>
Maximum wait time for Group Policy scripts = 1800 <br>
<br>
--- OR ---<br>
<br>
with a registry script : <br>
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]<br>
"MaxGPOScriptWait"=dword:00000708<br>
<br>
*** Step 2 *** (increase to 30 minutes “gpsvr service timeout”
for windows 7)<br>
with a registry script (launch at startup) : <br>
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\gpsvc]<br>
"PreshutdownTimeout"=dword:1b7740<br>
<br>
*** Step 3 *** (display script during shutdown)<br>
with gpo : <br>
Computer Configuration\Administrative Templates\System\Logon <br>
Run shutdown scripts visible = Enable<br>
Computer Configuration\Administrative Templates\System<br>
Verbose vs normal status messages = Enable<br>
<br>
--- OR ---<br>
<br>
with a registry script :<br>
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]<br>
"HideShutdownScripts"=dword:00000000<br>
" VerboseStatus"=dword:00000001<br>
<br>
<br>
*** step 4 *** (create and “secure” the user account “wpkguser” )<br>
<br>
Create a user account “wpkguser” (on domain or directly on the
server)<br>
<br>
All shares \\192.1.1.2\wpkg$, \\192.1.1.2\tools$,
\\192.1.1.2\sotware$ must be “read only” for user account
“wpkguser”.<br>
<br>
If necessary, disable windows logon for account “wpkguser” by
using a script logon like this “logoff.bat” :<br>
@echo off<br>
shutdown /l /f >nul<br>
<br>
*** Step 5 *** (run this script at shutdown with a gpo OR locally
with gpedit.msc)<br>
Computer Configuration \ Windows Settings \ Scripts \shutdown \
Wpkg.bat :<br>
@echo off<br>
cls<br>
echo.<br>
echo. ___________________________________________________<br>
echo i\ _________________________________________________\<br>
echo. i i i<br>
echo i i Mises a jour en cours : vous pouvez partir. i
<br>
echo. i i i
<br>
echo i i L'ordinateur s'eteindra lui-meme. i
<br>
echo. i i i
<br>
echo \i__________________________________________________i<br>
echo.<br>
echo.<br>
rem (disable mouse : thanks to Daniel Dehennin)<br>
start /B /d "%programfiles%\wpkg" nomousy /f -h >nul<br>
rem (with the user account "wpkguser" mount network map without
drive letter)<br>
net use \\192.1.1.2\wpkg$ /user:domain-or-computer\wpkguser
wpkgpassword >NUL<br>
rem (define the variables use in the packages)<br>
set TOOL=\\192.1.1.2\tools$<br>
set SOFTWARE=\\192.1.1.2\software$<br>
rem (call "wpkg.js" script )<br>
cscript //Nologo \\192.1.1.2\wpkg$\wpkg.js /synchronize /nonotify
/quiet <br>
rem (call a script "wpkgbaseclient.bat" to store wpkg.xml and .log
on server)<br>
call \\192.1.1.2\wpkg$\wpkgbaseclient.bat<br>
<br>
<br>
Good test !<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</font><br>
<pre class="moz-signature" cols="72">--
Bruno CHOQUET, responsable du service informatique de l'IUT d'Alençon.
correspondant informatique du site universitaire d'Alençon.
<a class="moz-txt-link-freetext" href="http://www.unicaen.fr/iutalencon">http://www.unicaen.fr/iutalencon</a>
Tel : 02.33.80.85.10
</pre>
</body>
</html>