Update. As Avi pointed out in comments to this post, my script does not handle root directories that invalid in Windows FileSystem space, because FSO does not see them when enumerating. I changed it to call of "DIR" command. And now I just delete them. Another minor (but important!) change was taking out skipping deletion of "RECYCLER" folder from the script. I got a case of invalid names under RECYCLER. Please use at your own risk.
If you've been doing XP to Wind 7 migrations in larger scale, you probably came across some computers out there that ended up tossed with NTLD missing error.
Not nice! After this happens, you'd probably boot and safe user's data from state store, and try to figure out what the hack happened. Looking in smsts.log reveals some details:
Reporting deletion progress. Unable to delete directory C:\Documents and Settings\***\Local Settings\Temp\OICE_43BCF28F-9C21-4A31-BC1E-52B54828BD6F.0 (0x80070091). Continuing. Unable to delete directory C:\Documents and Settings\***\Local Settings\Temp\OICE_930D53AE-2288-434E-97DD-C56505BB49CA.0 (0x80070091). Continuing. Unable to delete directory C:\Documents and Settings\***\Local Settings\Temp (0x80070091). Continuing. Unable to delete directory C:\Documents and Settings\***\Local Settings (0x80070091). Continuing.
Searching on the internet is giving you some clue. Most of the posts saying it's permissions, so you come up with the script that resets permissions, but this is still happening.
So what's the culprit?
Let's see what in that folder.
Directory of C:\Documents and Settings\***\Local Settings\Temp 02/14/2012 05:50 PM <DIR> . 02/14/2012 05:50 PM <DIR> .. 02/14/2012 05:50 PM <DIR> OICE_1ED1F44B-623B-49CB-91A9-3D5FF12339E9.0 02/14/2012 05:50 PM <DIR> OICE_450CAED0-70C4-4B0E-A799-4C20309918BE.0 0 File(s) 0 bytes Directory of C:\Documents and Settings\***\Local Settings\Temp\OICE_1ED1F44B-623B-49CB-91A9-3D5FF12339E9.0 02/14/2012 05:50 PM <DIR> . 02/14/2012 05:50 PM <DIR> .. 02/13/2012 07:28 PM 0 108D235B. 1 File(s) 0 bytes Directory of C:\Documents and Settings\***\Local Settings\Temp\OICE_450CAED0-70C4-4B0E-A799-4C20309918BE.0 02/14/2012 05:50 PM <DIR> . 02/14/2012 05:50 PM <DIR> .. 02/13/2012 06:12 PM 0 FE182149. 1 File(s) 0 bytes Total Files Listed: 2 File(s) 0 bytes 8 Dir(s) 300,889,800,704 bytes free
Notice highlighted files. They got a dot at the end.
Bingo! Look at this answer:http://stackoverflow.com/questions/4075753/how-to-delete-a-folder-that-name-ended-with-a-dot
Looks like OSDApplyOS does not use it to delete files, so we're in trouble.
So what creates it? I have a guess.
Looks like it's related somehow with Office Isolated Conversion Environment. So,
http://support.microsoft.com/kb/935865
I attached the script you can run if Apply OS Image failed before running Apply OS Image again.
Quick illustration:
How to use this script
This script needs ztiutility.vbs from MDT and it needs setacl.exe from http://sourceforge.net/projects/setacl/files/
If you use MDT, I recommend creating a Custom folder under Scripts on MDT package and copying the script and SetACL.exe into it.
Only If you DON'T use MDT change path to ZTIUtility from parent folder to current folder in the script
<script language="VBScript" src="..\ZTIUtility.vbs"/>
to
<script language="VBScript" src="ZTIUtility.vbs"/>
Copy SetAcl.exe, ZTIUtility.vbs and the script to a separate package in Configuration Manager.
TEST, TEST AND TEST
Try to create an "invalid" folder by using mkdir "\\?\C:\Screw my deployment with period at the end."
Set permissions on it removing Local System and administrators. Start OS Refresh.