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