• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Reboot made by wmiprvse.exe during first boot after sysprep

Scheduled Pinned Locked Moved Solved
Windows Problems
3
23
13.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    jmeyer
    last edited by jmeyer May 27, 2015, 3:42 AM May 27, 2015, 9:40 AM

    Hello,
    I run cmd script called from the unattend.xml of Windows sysprep.
    This script makes a 60s break to wait network to start then run SDI (Snappy Driver Installer) that works perfectly when run manually.
    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.
    I have run SAD (Stand Alone Driverpack) for a year using the same way without any reboot during the process.

    The only change made are that i was running SAD directly in the unattend.xml but now i call a cmd to run SDI.

    Does anyone have idea why I have this reboot, if i can avoid it or if i have made a stupid mistake somewhere ?

    Thank you.

    Here is all the details i can provide.

    Content of unattend.xml

    <FirstLogonCommands>
    	<SynchronousCommand wcm:action="add">
    		<CommandLine>C:\SDI.cmd</CommandLine>
    		<Order>1</Order>
    		<RequiresUserInput>true</RequiresUserInput>
    	</SynchronousCommand>
    	<SynchronousCommand wcm:action="add">
    		<CommandLine>cmd /c del C:\SDI.cmd</CommandLine>
    		<Order>2</Order>
    		<RequiresUserInput>true</RequiresUserInput>
    	</SynchronousCommand>
    	<SynchronousCommand wcm:action="add">
    		<CommandLine>cmd /c rmdir C:\Users\Administrateur\Desktop\sysprep /s /q</CommandLine>
    		<Order>3</Order>
    		<RequiresUserInput>true</RequiresUserInput>
    	</SynchronousCommand>
    </FirstLogonCommands>
    

    The cmd script

    @echo off
    echo %date% %time% Fichier de log cree >> C:\imageresults.txt 2>&1
    echo %date% %time% Demarrage du script >> 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% Montage du partage samba de fog >> C:\imageresults.txt 2>&1
    NET USE z: \\fogserver\Drivers
    Z:
    if not %cd% == Z:\ goto nofog
    echo %date% %time% Installation drivers via SDI >> C:\imageresults.txt 2>&1
    FOR /F "tokens=*" %%G IN ('DIR /B *.exe') do start /wait %%G -autoinstall -nologfile -autoclose -license
    C:
    NET USE /delete /yes Z:
    :nofog
    ::echo %date% %time% Activation Windows >> C:\imageresults.txt 2>&1
    ::cscript C:\Windows\system32\slmgr.vbs /ato >> C:\imageresults.txt 2>&1
    shutdown -r -t 30
    exit
    
    W 1 Reply Last reply May 27, 2015, 8:14 PM Reply Quote 0
    • W
      Wayne Workman
      last edited by May 27, 2015, 12:27 PM

      your CMD script.

      I added output to the part that installs the drivers. Perhaps it might give clues?

      [CODE]@echo off
      echo %date% %time% Fichier de log cree >> C:\imageresults.txt 2>&1
      echo %date% %time% Demarrage du script >> 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% Montage du partage samba de fog >> C:\imageresults.txt 2>&1
      NET USE z: \fogserver\Drivers
      Z:
      if not %cd% == Z:\ goto nofog
      echo %date% %time% Installation drivers via SDI >> C:\imageresults.txt 2>&1
      FOR /F “tokens=*” %%G IN (‘DIR /B *.exe’) do start /wait %%G -autoinstall -nologfile -autoclose -license >> C:\DriverInstallOutput.txt
      😄
      NET USE /delete /yes Z:
      :nofog
      ::echo %date% %time% Activation Windows >> C:\imageresults.txt 2>&1
      ::cscript C:\Windows\system32\slmgr.vbs /ato >> C:\imageresults.txt 2>&1
      shutdown -r -t 30
      exit[/CODE]

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
      Daily Clean Installation Results:
      https://fogtesting.fogproject.us/
      FOG Reporting:
      https://fog-external-reporting-results.fogproject.us/

      1 Reply Last reply Reply Quote 0
      • J
        jmeyer
        last edited by jmeyer May 27, 2015, 8:06 AM May 27, 2015, 1:55 PM

        Thank you for your reply.

        I’m sure drivers install is not related to the reboot problem because, as i said, the timeout command is stopped before the 60 second.

        I’ll repeat in case i wasn’t clear :

        • Case 1 with the timeout command : countdown is stopped before reaching 0.
        • Case 2 without the timeout command : SDI is forced to closed during install.

        I have tested most of the posibilities possible during few days (this script was in setupcomplete.cmd at first) such as removing the timeout command, reducing it, adding or removing some “start /wait” or “cmd /c” in the xml.
        I ended adding the %time% and the %date% to check system event and i see clearly a message saying that “wmiprvse.exe has initiated the restart of computer” but there is no more details.

        I start to think that the computer doesn’t see that there is a script running so here my last test left, just set a “pause”.

        1 Reply Last reply Reply Quote 0
        • J
          jmeyer
          last edited by May 27, 2015, 2:39 PM

          I have just make a test with only a “pause” in the script and there is no unwanted reboot.

          W 1 Reply Last reply May 27, 2015, 3:29 PM Reply Quote 0
          • W
            Wayne Workman @jmeyer
            last edited by May 27, 2015, 3:29 PM

            @jmeyer

            Can you post your new script?

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            1 Reply Last reply Reply Quote 0
            • J
              jmeyer
              last edited by May 27, 2015, 7:56 PM

              When i say only pause, it’s only a pause

              pause
              

              lol

              1 Reply Last reply Reply Quote 0
              • W
                Wayne Workman
                last edited by May 27, 2015, 7:57 PM

                @jmeyer said:

                shutdown -r -t 30

                that part causes a reboot… just clarifying… didn’t know if you knew or not.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                Daily Clean Installation Results:
                https://fogtesting.fogproject.us/
                FOG Reporting:
                https://fog-external-reporting-results.fogproject.us/

                1 Reply Last reply Reply Quote 0
                • J
                  jmeyer
                  last edited by May 27, 2015, 7:58 PM

                  Reboot appears during

                  timeout /t 60 /nobreak 
                  
                  1 Reply Last reply Reply Quote 0
                  • W
                    Wayne Workman
                    last edited by May 27, 2015, 7:59 PM

                    Can you remove the shutdown -r -t 30 and just see what happens?

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                    Daily Clean Installation Results:
                    https://fogtesting.fogproject.us/
                    FOG Reporting:
                    https://fog-external-reporting-results.fogproject.us/

                    1 Reply Last reply Reply Quote 0
                    • J
                      jmeyer
                      last edited by jmeyer May 27, 2015, 2:05 PM May 27, 2015, 8:03 PM

                      I did but the script never reach this line as it’s forced to stop for the reboot during the 60 seconds of the timeout command.

                      I know you’ll look for basic reason but I have tested so many things that I’m out of idea.

                      1 Reply Last reply Reply Quote 0
                      • W
                        Wayne Workman
                        last edited by Wayne Workman May 27, 2015, 2:12 PM May 27, 2015, 8:12 PM

                        Are there alternatives for wmiprvse.exe ?

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                        Daily Clean Installation Results:
                        https://fogtesting.fogproject.us/
                        FOG Reporting:
                        https://fog-external-reporting-results.fogproject.us/

                        1 Reply Last reply Reply Quote 0
                        • J
                          jmeyer
                          last edited by May 27, 2015, 8:13 PM

                          What do you mean ?

                          1 Reply Last reply Reply Quote 0
                          • W
                            Wayne Workman @jmeyer
                            last edited by May 27, 2015, 8:14 PM

                            @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.

                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                            Daily Clean Installation Results:
                            https://fogtesting.fogproject.us/
                            FOG Reporting:
                            https://fog-external-reporting-results.fogproject.us/

                            1 Reply Last reply Reply Quote 0
                            • J
                              jmeyer
                              last edited by jmeyer May 28, 2015, 12:43 AM May 27, 2015, 8:17 PM

                              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.

                              1 Reply Last reply Reply Quote 0
                              • J
                                jmeyer
                                last edited by jmeyer May 28, 2015, 12:45 AM May 27, 2015, 8:31 PM

                                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.

                                W 1 Reply Last reply May 28, 2015, 12:30 PM Reply Quote 0
                                • W
                                  Wayne Workman @jmeyer
                                  last edited by May 28, 2015, 12:30 PM

                                  @jmeyer What were your findings?

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                                  Daily Clean Installation Results:
                                  https://fogtesting.fogproject.us/
                                  FOG Reporting:
                                  https://fog-external-reporting-results.fogproject.us/

                                  1 Reply Last reply Reply Quote 0
                                  • J
                                    jmeyer
                                    last edited by May 29, 2015, 6:52 AM

                                    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.

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      jmeyer
                                      last edited by May 29, 2015, 9:15 AM

                                      My script launch edition didn’t solved the problem.
                                      I try again with fog service disabled.

                                      1 Reply Last reply Reply Quote 0
                                      • F
                                        FlowLive
                                        last edited by FlowLive Dec 16, 2015, 3:36 PM Dec 16, 2015, 9:36 PM

                                        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?

                                        J 1 Reply Last reply Dec 17, 2015, 7:07 AM Reply Quote 0
                                        • J
                                          jmeyer @FlowLive
                                          last edited by jmeyer Dec 17, 2015, 1:14 AM Dec 17, 2015, 7:07 AM

                                          @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
                                          
                                          F 1 Reply Last reply Jan 15, 2016, 5:09 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post

                                          196

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project