Reboot made by wmiprvse.exe during first boot after sysprep
-
What do you mean ?
-
@jmeyer said:
During the script process, i have a reboot requested by wmiprvse.exe (WMI Provider Host).
This happen during the 60s, or during driver installation when i remove the 60s delay.You said you think this is what’s causing your reboot. I was wondering if there were any alternatives that may give you less trouble.
-
Since I don’t know what trigger this reboot, I don’t even know where to start to dodge this reboot.
I don’t know if there is other way to run a script after a sysprep.
I only know with the setupcomplete.cmd or adding call of commands in the unattend.xml. -
Is the fog client use this exe to reboot the computer ?
Thomas use kinda the same script without problem but disable the fog service and that the only thing that I see that could explain a reboot.
Yet, i don’t see what a simple “pause” can change from a “timeout” to avoid this reboot.I’ll test again with fog service disabled or the client remove to find if it comes from the fog client.
I can also try with a fresh OS install in case Windows Update did something. -
@jmeyer What were your findings?
-
I have called for help from a old fellow worker.
He as said to try to replace the “timeout” command by a “ping 127.0.0.1”.
But, I think i have find a way to avoid this reboot during the script process.
I call my script in the unattend.xml like this “cmd /c start /wait Myscript.cmd”.
I wasn’t on site and I wanted to test it in the same condition (with the same fog server) in case it’s the fog client that makes this unwanted reboot (it’s Tom Elliott only idea to my problem).
I run few last test today and i keep you update. -
My script launch edition didn’t solved the problem.
I try again with fog service disabled. -
I realize this is a few months old thread, jmeyer did you ever get it to work?
I am presently trying pretty much the same.
Did you ever succeed?
-
@FlowLive
It was fog client that was calling the reboot.
I just disable it before sysprep and enable it in script.I set most of it in a script in a smb share called by SetupComplete.cmd to not have to edit my image but be able to enhance it.
It works great and I use this script to do the most of task needed after deploy : drivers, windows activation and few basic software installation.
I even tested and validated it under Windows 10 few days ago.Days of work that finally pay back.
SetupComplete.cmd
@echo off echo %date% %time% Demarrage du script SetupComplete >> C:\imageresults.txt 2>&1 del /Q /F %windir%\system32\sysprep\unattend.xml >> C:\imageresults.txt 2>&1 del /Q /F %windir%\panther\unattend.xml >> C:\imageresults.txt 2>&1 echo %date% %time% Attente de 60 secondes pour activation du LAN >> C:\imageresults.txt 2>&1 timeout /t 60 /nobreak >> C:\imageresults.txt 2>&1 echo %date% %time% Fin des 60s >> C:\imageresults.txt 2>&1 echo %date% %time% Montage du partage samba de fog >> C:\imageresults.txt 2>&1 NET USE z: \\fogserver\AfterDeploy echo %date% %time% Net use effectué >> C:\imageresults.txt 2>&1 Z: if not %cd% == Z:\ goto nofog echo %date% %time% Dossier actuel %cd% >> C:\imageresults.txt 2>&1 echo %date% %time% Chargement du script AfterDeploy >> C:\imageresults.txt 2>&1 start /wait AfterDeploy.cmd C: NET USE /delete /yes Z: echo %date% %time% Lecteur Z demonte >> C:\imageresults.txt 2>&1 :nofog ::echo %date% %time% Activation Windows >> C:\imageresults.txt 2>&1 ::cscript C:\Windows\system32\slmgr.vbs /ato >> C:\imageresults.txt 2>&1 echo Activation du service FOG en demarrage automatique >> C:\imageresults.txt sc config "FOG Service" start= auto >> C:\imageresults.txt 2>&1 net start "FOG Service" >> C:\imageresults.txt 2>&1 shutdown -r -t 30 echo %date% %time% Reboot >> C:\imageresults.txt 2>&1 exit
AfterDeploy.cmd
echo %date% %time% - Script AfterDeploy - Changement de dossier : %cd% >> C:\imageresults.txt 2>&1 cd /SDI echo %date% %time% - Script AfterDeploy - Lancement de SDI >> C:\imageresults.txt 2>&1 IF %cd% == Z:\SDI start /wait SDI_auto.bat -autoinstall -nologfile -autoclose -license echo %date% %time% - Script AfterDeploy - Fin script SDI >> C:\imageresults.txt 2>&1 cd .. cd /ActivationWin7 echo %date% %time% - Script AfterDeploy - Lancement de Activation OEM Windows >> C:\imageresults.txt 2>&1 cscript ActivationWin7.vbs echo %date% %time% - Script AfterDeploy - Fin script activation >> C:\imageresults.txt 2>&1 cd .. echo %date% %time% - Script AfterDeploy - Modification pour désactiver AutoAdminLogon REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 0 /f echo %date% %time% - Script AfterDeploy - Modification registre effectuée cd /Logiciels echo %date% %time% - Script AfterDeploy - Lancement Install logiciels>> C:\imageresults.txt 2>&1 cscript Logiciels.vbs echo %date% %time% - Script AfterDeploy - Fin Install logiciels >> C:\imageresults.txt 2>&1 cd .. cd /IACA echo %date% %time% - Script AfterDeploy - Lancement de Auto Install IACA >> C:\imageresults.txt 2>&1 Auto_Install_Client.exe /NOREBOOT /YES /AM=N echo %date% %time% - Script AfterDeploy - Fin Auto Install IACA >> C:\imageresults.txt 2>&1 cd .. echo %date% %time% - Script AfterDeploy - Fermeture de script AfterDeploy.cmd >> C:\imageresults.txt 2>&1 exit
-
Hi @jmeyer,
I have a question, I am trying this script now, the problem I have is your AfterDeploy.cmd you have set a start /wait SDI_auto.bat but since that closes after it successfully called the .exe the script goes on without having a chance to finish SDI install of drivers…
Are you sure this is how you have it?
I am also getting a prompt for firewall access to let SDI through on launch of the .exe, have you had that happen?
I am also running those script from \fogserver\share…
I see you had a previous version that called the .exe directly which from my understanding would have actually /wait succesfully until completion, or did you alter the SDI_auto.bat somehow to have another /wait in there is at all possible?
I see that my service is FOGService and not FOG Service, had to change that…
Thanks! Love your script!
-
@FlowLive
I think you are right about the start /wait of the cmd.
But I have this on the .bat of SDI :start /wait "Snappy Driver Installer" /d"%~dp0" "%~dp0%SDIEXE%" %1 %2 %3 %4 %5 %6 %7 %8 %9
The web access of SDI is to check driver packages update.
Fog service name depend of the version you use on the OS of the image you are going to make. -
Thanks jmeyer this works great!