Wait between Steps



  • Scott Sweeten

    a sleep command fails with "Failed to connect to the service manager.."

    The PDQ Sleep step fails with that error? I thought the Sleep step was literally a "wait x seconds until moving to next step". I've never seen Sleep error and didn't know it was even possible.

    Comment actions Permalink
  • Colby Bouma

    Deploy still connects to the target machine before running the step. The issue is that Deploy didn't issue the reboot, so it gets confused. There is an internal feature request for a way to account for this, but I have no ETA on when/if it will happen.

    Comment actions Permalink
  • R M

    thanks for the info colby

    Comment actions Permalink
  • ZayScott

    I know this is an old thread, but I stumbled on it and wanted to share a suggested approach. I did the same thing, and use the setupcomplete.cmd to do it. When you run your setup command, simply add the /postoobe step and point it to your setupcomplete.cmd file that has all your commands, steps in it. If you are doing it with PowerShell, add a line as such: powershell.exe -executionpolicy bypass -file <pathtoyourpowershellscript.ps1>. To keep things simple, I created a folder that had all my scripts, etc. I have even used the setupcomplete.cmd to install drivers. Below is a sample of one of my setupcomplete.cmd scripts

    ::Delete the scheduled task
    schtasks /delete /tn "Windows 10 Upgrade" /f

    ::Disable Windows Hi animation & UAC Settings
    regedit /s "C:\Temp\Win10_1909\Post\disable-hi-animation.reg"
    powershell.exe -executionpolicy bypass -file "C:\Temp\Win10_1909\Post\Disable_OOBE_Stuff.ps1"

    ::Install M73 Video Driver
    wmic csproduct get version | findstr /i "ThinkCentre M73"
    If not %errorlevel% ==0 goto M73 else (goto M700)
    cmd /c "C:\Temp\Win10_1909\M73\driver.cmd"

    ::Install M700 Video Driver
    wmic csproduct get version | findstr /i "ThinkCentre M700"
    If not %errorlevel% ==0 goto End2
    cmd /c "C:\Temp\Win10_1909\M700\driver.cmd"
    cscript C:\Windows\System32\slmgr.vbs /ATO
    GPUPDATE /force
    ::Install Lenovo System Update
    cmd /c C:\temp\Win10_1909\Post\Lenovo_System_Update.cmd

    ::execute Debloat Windows script
    powershell.exe -executionpolicy bypass -file "C:\Temp\Win10_1909\Post\Debloat_Windows_10v1809.ps1" -AppsOnly -AppAccess

    ::Register DNS
    ipconfig /registerdns

    ::Import default App Associations
    dism.exe /online /import-defaultappassociations:C:\temp\Win10_1909\Post\AppAssociations\AppAssociations.xml

    ::Force OCS Inventory Update
    "C:\Program Files (x86)\OCS Inventory Agent\OCSInventory.exe" /force
    "C:\Program Files\OCS Inventory Agent\OCSInventory.exe" /force

    ::Windows update installation KB4534273
    C:\Windows\System32\wusa.exe "C:\Temp\Win10_1909\Post\Windows_10_Version_1809_for_x64-based_Systems_(KB4534273).msu" /quiet /norestart /log:C:\Eurofins\Logs\Windows_10_Version_1809_for_x64-based_Systems_(KB4534273).evtx

    ::Windows 10 start menu customization
    powershell.exe -executionpolicy bypass Import-StartLayout -LayoutPath C:\Temp\Win10_1909\Post\Windows10_StartMenu.bin -MountPath C:\

    ::Windows 10 taskbar customization
    Reg.exe load HKEY_LOCAL_MACHINE\defuser C:\users\default\ntuser.dat
    Reg.exe import "C:\Temp\Win10_1909\Post\PinTaskBar\Win10_1909Taskbar.reg"
    Reg.exe unload HKEY_LOCAL_MACHINE\defuser
    Xcopy C:\Temp\Win10_1909\Post\PinTaskBar\*.lnk "C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" /Q /Y /I

    ::Remove BUiltin Apps
    powershell.exe -executionpolicy bypass -file C:\temp\Win10_1909\Post\Remove-BuiltinApps.ps1
    powershell.exe -executionpolicy bypass -file C:\temp\Win10_1909\Post\Remove-UWP_Apps.ps1

    ::wait for postOOOBE to complete
    Timeout /T 180
    :: Delete the W10_Upgrade.cmd file to prevent task from running again
    Del /Q /S C:\Temp\Win10_1909\W10_Upgrade.cmd
    ::Del /S /S C:\Temp\Win10_1909\*.*
    ::Remove entire Win10_1909 folder
    RMDIR /S /Q C:\Temp\Win10_1909

    ::Install M73 Video Driver
    wmic csproduct get version | findstr /i "M73"
    If not %errorlevel% ==0 goto end
    C:\tempresdir\M73\igxpin.exe -s

    ::Install M700 Video Driver
    wmic csproduct get version | findstr /i "M73"
    If not %errorlevel% ==0 goto end

    C:\TempRESDir\M700\igxpin.exe -s

    As mentioned, this is my folder structure. Keep in mind, I used the setupconfig.ini file


    Comment actions Permalink

Please sign in to leave a comment.