[quote=“Lee Rowlett, post: 7960, member: 28”]i actually have a solution for this, i’ve written code so that once fog has deployed the image to the machine it will change sysprep.inf for xp and unattend.xml to the hostname in the fog database and will add ad information from fog if set to join AD so when sysprep runs it already matches what has been set in FOG, this would solve all this but i don’t think the developers will go for it as it renders hostname change early un-needed and these features in FOGClient are no longer needed. if you want info on how to do this pm me as it’d be a lengthy tutorial/set of instructions to write. if a few people find it easy to implement then i’ll post an how to when i have the time to sit down and write one up…[/quote]
Haha, I would like to see that, actually. Although - if you’d like to keep it short and simple, could you tell me exactly where (and as a result, when) the code is being executed to open and alter unattend.xml? Are you running a MySQL query from the computer being imaged to grab the computer name? I could probably figure it out from there.
I actually had a system in place which would actually open up and edit the unattend file mid sysprep, by adding this registry key right before restarting, but after sysprepping -
“reg add HKLM\System\Setup /v CmdLine /t REG_SZ /d “cmd /c cscript //nologo C:\windows\system32\sysprep\editunattend.vbs” /f”
Editunattend.vbs would essentially open up c:\Windows\Panther\unattend.xml, expand the environment variable for %COMPUTERNAME% that was in place, look for a string called “REPLACEME” in the unnattend file, and swap the strings and resave the file. Then it would kick off %WINDIR%\System32\oobe\windeploy.exe and sysprep would continue like normal.
Never got it to work though – it would work when there was a msgbox asking for the computer name as an input, so I’m thinking the %COMPUTERNAME% variable is either blank or unavailable when it tries running. Which is a shame.