• Sorry - this post should be in support thread.


  • setupcompletecmd_complete

    Is created immediately after sysprep finishes applying the unattended setup on first boot after it images.

    image_prepped

    Is created just before sysprep runs when creating the image before it shuts down.

    They are both deleted when the cleanup policy runs that is attached to the Built-In Image First Run group.

    If it never joins the domain, the cleanup should never run, but it depends on how you setup your policy. If the time is incorrect, I would just add the following cmd to your setup complete cmd. Just add it before the net start toec command.

    w32tm /config /manualpeerlist:yourtimeserver
    net stop w32time
    net start w32time


  • @theopenem_admin Thank you for explanation.
    Finally, I put that time server settings into unatended.xml file for sysprep. That works for me just fine.
    For info how to call cmd script from sysprep:

    <settings pass="specialize">
    		<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <RunSynchronous>
                    <RunSynchronousCommand wcm:action="add">
                        <Order>1</Order>
                        <Path>c:\Windows\system32\cmd.exe /c c:\intel\synctime.cmd</Path>
                    </RunSynchronousCommand>
                </RunSynchronous>
            </component>
        </settings>
    

    Tomas


  • @theopenem_admin - I made many of reinstallation and tests, but the file "setupcompletecmd_complete" is never created on my machines. (image_prepped is present after imaging).

    So, if I do "domain join" policy with condition on "setupcompletecmd_complete" policies are not started

    • if I login under admin I don't see that file (policies never run and sysprep looks finished)

    and in opposite if I do test on "image_prepped" computer is joined to domain, and other following policies apply (include collect inventory), and finally "Image Prep Cleanup"

    • so hard to say if "setupcompletecmd_complete" is present

    Other observation is: file c:\Windows\System32\Sysprep\Sysprep_succeeded.tag was created.

    Tomas


  • What's in your setup complete template?


  • @theopenem_admin it's default (Toec Image Prep without server access because time server is not setup yet, but during sysprep later):

    mkdir "%ProgramFiles%\Toec"
    net stop toec /y >> "%ProgramFiles%\Toec\setupcomplete.log"
    powercfg.exe /h off >> "%ProgramFiles%\Toec\setupcomplete.log"
    copy NUL "%ProgramFiles%\Toec\setupcompletecmd_complete" >> "%ProgramFiles%\Toec\setupcomplete.log"
    del /Q /F c:\windows\system32\sysprep\unattend.xml >> "%ProgramFiles%\Toec\setupcomplete.log" 
    del /Q /F c:\windows\panther\unattend.xml >> "%ProgramFiles%\Toec\setupcomplete.log"
    
    REM ####### Driver install ###########
    PowerShell ^
    $Drivers = Get-ChildItem "C:\drivers" -Recurse -Filter "*.inf" ;^
    ForEach($Driver in $Drivers) {;^
    $args = \"/add-driver $($Driver.FullName) /install \";^
    $p = (Start-Process -FilePath pnputil.exe -ArgumentList $args -NoNewWindow -Passthru);^
    Wait-Process -Id $p.Id -Timeout 10 >> "%ProgramFiles%\Toec\setupcomplete.log";^
    };^
    %End PowerShell%
    
    net start toec /y
    
    

    Tomas


  • @tomas-hook Just to be clear - I run "Toec Image Prep" without server connection. Simillar to older version when this feature was not present.


  • It should be created from this line.

    copy NUL "%ProgramFiles%\Toec\setupcompletecmd_complete"

    I wonder if your setupcomplete.cmd isn't running for some reason. After you deploy the image, does the file exist at C:\Windows\Setup\scripts


  • @theopenem_admin said in creating base image:

    After you deploy the image, does the file exist at C:\Windows\Setup\scripts

    Well, I was not sure either, because:

    • I never saw "%Program Files%\Toec\setupcomplete.log" file.
    • c:\windows\panter\unattend.xml exists.
    • c:\windows\system32\sysprep\unattend.xml exists.

    File "c:\windows\setup\scripts\setupcomplete" exists on my deployed machine.


  • It sounds like it's not running then, but I'm not sure why. Windows should run that file automatically if it exists in that location. I've never seen it not run.



  • Hmm, I never knew that setup complete would not run with an OEM license. I guess you would just need to change your policies a little to work with your setup.