Post-Setup - Some commands were not executed

garson

Member
I'm trying to add some commands to Post-Setup section of LTSC, most of commands were executed successfully, but several did not.
SetupComplete.cmd looks fine.
Setup is unattended and local Administrator account is enabled and used for first login.

I have several schtasks commands but these 2 are not executed:
schtasks /Change /Disable /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask"
schtasks /Change /Disable /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan"

Normally, these 2 would need to be run with system user, which should be the case in Post-Setup.
If I run same SetupComplete.cmd with psexec as system user, everything is fine.

Also, these rd commands are not executed:
rd "%SystemDrive%\Users\Administrator\AppData\Local\Microsoft\Windows\History" /s /q
rd "%SystemDrive%\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache" /s /q
rd "%SystemDrive%\Users\Administrator\AppData\Local\Microsoft\Windows\INetCookies" /s /q
rd "%SystemDrive%\Users\Administrator\AppData\Local\Microsoft\Windows\WebCache" /s /q

Maybe rd commands are not execetud because Administrator's folder structure is not yet created when SetupComplete.cmd runs?

Any hints would be appreciated.
 
Yes, user folder is not yet created during setupcomplete.cmd stage. I have very similar problem where I want to copy some files to just created user Desktop (only single user, so no Default or Public folders can help me here). No solution whatsoever at the moment or at least I have not yet come to one. Currently trying something with RunOnceEx registry...
 
Yes, user folder is not yet created during setupcomplete.cmd stage. I have very similar problem where I want to copy some files to just created user Desktop (only single user, so no Default or Public folders can help me here). No solution whatsoever at the moment or at least I have not yet come to one. Currently trying something with RunOnceEx registry...
Just try my tutorial. It works very well.
 
SetupComplete.cmd runs under Least Privileges local system (similar to administrator or less)

you can use SCHTASKS to create temporary task as ro run as System and execute the non working commands
 
Back
Top