Quantcast
Channel: Windows 8.1 Installation, Setup, and Deployment forum
Viewing all articles
Browse latest Browse all 5362

Unattend.xml - FirstLogonCommands - Some won't run?

$
0
0

So!  I'm building something that requires creating unattend.xml files.  I'm getting bogged down in an issue with the FirstLogonCommands section.

<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend"><settings pass="specialize"><component name="Microsoft-Windows-Shell-Setup" 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"><ComputerName>EXAM22</ComputerName><TimeZone>Eastern Standard Time</TimeZone></component></settings><settings pass="oobeSystem"><component name="Microsoft-Windows-Shell-Setup" 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"><UserAccounts><AdministratorPassword><Value>p@ssw0rd!</Value><PlainText>true</PlainText></AdministratorPassword></UserAccounts><AutoLogon><Password><Value>p@ssw0rd!</Value><PlainText>true</PlainText></Password><Username>Administrator</Username><LogonCount>1</LogonCount><Enabled>true</Enabled></AutoLogon><FirstLogonCommands><SynchronousCommand wcm:action="add"><Order>1</Order><CommandLine>cmd.exe /c reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f</CommandLine><Description>ChangeHideFiles</Description></SynchronousCommand><SynchronousCommand wcm:action="add"><Order>2</Order><CommandLine>powershell.exe -noprofile -executionpolicy bypass -command "Set-Content C:\test 'WHATTHEHELL' -force"</CommandLine><Description>PSell</Description></SynchronousCommand></FirstLogonCommands><RegisteredOrganization>ORG</RegisteredOrganization><RegisteredOwner>USER</RegisteredOwner><OOBE><HideEULAPage>true</HideEULAPage><SkipMachineOOBE>true</SkipMachineOOBE></OOBE></component></settings><cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" /></unattend>

Everything above applies, apart from the FirstLogonCommands section.  For that, the registry change does not take effect, but the PowerShell command does.  Copying and pasting the registry change, it applies with no issue manually.  Have tried this with other syntax (e.g. C:\windows\system32\reg.exe ...).

What would cause that command to not run, while the other command, while the powershell command does run without issue?

Your insight would be greatly appreciated!


Viewing all articles
Browse latest Browse all 5362

Trending Articles