Leftover files after .NET Framework 3.5 Service Pack 1 installation

Some of you might have noticed that after installing the .NET Framework 3.5 Service Pack 1, there can be a leftover folder in the root of the system as shown in the picture below.

image

We identified this issue right after .NET 3.5 SP1 was installed,  and found out soon that we were not the only ones having this issue. Microsoft describes this behavior in KB951847 and confirms the folder can be deleted.

After you install the .NET Framework 3.5 SP1 in Windows XP or Windows Server 2003, there is an arbitrary folder that is generated in the root of drive C. This folder contains two subfolders that are named amd64 and i386. These two subfolders both include the following files:

Filterpipelineprintproc.dll
Msxpsdrv.cat
Msxpsdrv.inf
Msxpsinc.gpd
Msxpsinc.ppd
Mxdwdrv.dll
Xpssvcs.dll

These files were pending to be deleted from the XPSEPSC installation.

But deleting that folder doesn’t appear to be so easy. When trying to delete the folder, you get the following error message:

image

When taking a closer look, you will notice that the folder as special permissions set, so the only way to get rid of this folder is to first take ownership of the content and then delete the folder. When working in an enterprise environment where we are used to automate things, manual steps are not an option, things must run in an automated way.

So we created a script. Since the folder names used by the windows update process are created randomly, we first need to identify the folder name. This is done by simply searching for the file mxdwdrv.dll that is not located in the Windows folder. Once we have identified the random folder name we need to take ownership of the folder before deleting it. We use the SubInACL resource kit utility from Microsoft to take ownership of the folder. Finally we can delete the folder.

Note that the below script will only work if the system was rebooted after the .NET Framework 3.5 SP1 installation.

dotnet35leftoverfix.vbs

[sourcecode language=”vb”]
‘ dotnet35leftoverfix.vbs
‘ version 1.0
‘ 03.08.2009
The script expects SubInACL.exe to be present within the same folder as the script itself. </span>
Dim WshShell : SET WshShell = CreateObject("WScript.Shell")
Dim oFSO : SET oFSO = CreateObject("Scripting.FileSystemObject")
‘Find where mxdwdrv.dll is located other than c:\windows
Dim colFSOSubFolders
‘On Error Resume Next
Set oFolder = oFSO.GetFolder("C:\")
Set colFSOSubfolders = oFolder.Subfolders
For Each objSubfolder in colFSOSubfolders
‘if its found it in WINDOWS then ignore it
if ucase(objSubfolder.Name) <> "WINDOWS" then
    if oFSO.FileExists("C:\" & objSubfolder.Name & "\i386\mxdwdrv.dll") then
        ‘ok this subfolder name is what I need to go after
        cmdline = fcurdir & "subinacl /subdirectories " & objSubfolder & "\*.* /setowner=Administrator /grant=Administrator=F"
        msgbox cmdline
        wshshell.run cmdline , ,true
        oFSO.DeleteFolder(objSubfolder)
    end if
end if
Next
function fCurDir()
set o=CreateObject("Scripting.FileSystemObject")
set of=o.GetFile(WScript.ScriptFullName)
fCurDir=of.ParentFolder&"\"
set of=Nothing
set o=Nothing
end function
[/sourcecode]

This script is provided “as is”.  The author offers no warranty or guarantee of any kind. Use of this script is at your own risk. The author takes no responsibility for loss of data.

UPDATE 27. October 2009

If you are working in an enterprise environment and want to get rid of the folder in an automated way on many systems, the above script might be of use for you. If you are a HOME user and have no scripting skills, I recommend you use one of the manual based solutions below. Thanks to all those that have contributed to this article.

51 Replies to “Leftover files after .NET Framework 3.5 Service Pack 1 installation”

  1. I just encountered this problem, and I can’t delete the folders. But I have no idea how to run scripts. I’m running XP Home, and I can’t seem to “gain ownership” of the folder that contains these leftovers. Can you please help a total noob?

    Thank you.

  2. Hi Bret,

    Ok, let’s give it a try. First download the subinacl.exe from Microsoft. Simply click on the SubinAcl link i provided in the article, you will then be redirected to the Microsoft Download link, select download , then select RUN, the file will be downloaded and the installation then should start, simply follow the instructions, when completed you should have the subinacl.exe installed under C:\Program Files\Windows Resource Kits\Tools\

    Now we need to prepare the dotnet35leftoverfix.vbs script. Open notepad and copy paste the GREEN marked code. Then save the content , note that you must have vbs as file extenion, not .txt. For simplicity, save the file into C:\Program Files\Windows Resource Kits\Tools\. Open explorer , navigate to that location and launch the script by double clicking it.

    I haven’t tested this on XP home, but it’s worth to give it a try. let me know if that worked, if not i can try to send you the stuff via e-mail.
    cheers
    Alex

  3. I just ran the script on my Windows XP Home machine and I got the following error message right off the bat:

    Windows Script Host:
    Script: C:\Program Files\Windows Resource Kits\Tools\dotnet35leftoverfix.vbs
    Line: 1
    Char: 1
    Error: Invalid character
    Code: 800A0408
    Source: Microsoft VBScript compilation error

    My leftover files did not install on C: drive where my operating system is. The folder installed on my secondary internal drive. I copied only the green part above. I tried it in WordPad and in NotePad, copying it fresh from the website each time.

    Any thoughts?

  4. I am also annoyed by that pesky Filterpipelineprintproc.dll.
    I have XP Professional.

    I’ve tried your solution. Followed your instructions exactly.
    Installed subinacl.exe into C:\Program Files\Windows Resource Kits\Tools\. Copied your script into Notepad and saved it as dotnet35leftoverfix.vbs.
    When I run it I get the following Windows Script Host error:

    Script: C:\Program Files\Windows Resource Kits\Tools\dotnet35leftoverfix.vbs
    Line: 25
    Char: 9
    Error: The system cannot find the file specified
    Code: 8007002
    Source: (null)

  5. For all those using XP Home, I will see if i get a chance to install XP home and sort that out. For those that have the leftover files on another drive, modify the script, as the current script only searches the C drive.

  6. @lilsassy: The error you are seeing is because the VBScript interpreter in Windows XP does not support the character ‘ as an remark. To fix your issue just search for ‘ and replace it with REM. The script then should look +/- like this:
    REM dotnet35leftoverfix.vbs
    REM version 1.0
    REM 03.08.2009
    REM ——————————–

    REM The script expects SubInACL.exe to be present within the same folder as the script itself.

    Dim WshShell : SET WshShell = CreateObject("WScript.Shell")
    Dim oFSO : SET oFSO = CreateObject("Scripting.FileSystemObject")

    REM Find where mxdwdrv.dll is located other than c:\windows
    Dim colFSOSubFolders
    REM On Error Resume Next
    Set oFolder = oFSO.GetFolder("C:\")
    Set colFSOSubfolders = oFolder.Subfolders
    For Each objSubfolder in colFSOSubfolders
    REM if its found it in WINDOWS then ignore it
    if ucase(objSubfolder.Name) "WINDOWS" then
    if oFSO.FileExists("C:\" & objSubfolder.Name & "\i386\mxdwdrv.dll") then
    REM ok this subfolder name is what I need to go after
    cmdline = fcurdir & "subinacl /subdirectories " & objSubfolder & "\*.* /setowner=Administrator /grant=Administrator=F"
    msgbox cmdline
    WshShell.run cmdline , ,true
    oFSO.DeleteFolder(objSubfolder)
    end if
    end if
    Next

    function fCurDir()
    set o=CreateObject("Scripting.FileSystemObject")
    set of=o.GetFile(WScript.ScriptFullName)
    fCurDir=of.ParentFolder&"\"
    set of=Nothing
    set o=Nothing
    end function

    // Steve

  7. 2 problems i think
    #1 is that when you paste the script into notepad, it pastes it in with ‘fancy’ single quotes instead of straight ones. you have to replace all of those with straight single quote marks.

    #2 when i ran it it couldn’t find the file wshshell.run.

    but! after fixing the first problem it got far enough through the script that after i ran it i was able to then just go to the folder and delete it.

  8. Hi Alex, thanks for this script. Unfortunately I’m having the same error message as John, on Windows XP Professional x64 Edition.

    The resolution to Lilsassy’s error is that the quote mark character used for the code comments are ‘ when they should be ‘. Probably just Alex’s browser being too clever for its own good when he posted this article. To notepad, this is a curly quote rather than a straight quote – find and replace ‘ for ‘ and you’re good to go.

  9. Hi Alex, I ran the script and got the following error:

    Script: D:\dotnet35leftoverfix.vbs
    Line: 27
    Char: 9
    Error: Permission denied
    Code: 800A0046
    Source: Microsoft VBScript runtime error

    Appreciate if you could provide further assistance, thanks.

  10. Hi Alex. I made the improvements you suggested and now I’m getting this error:

    Script: C:\Program Files\Windows Resource Kits\Tools\dotnet35leftoverfix.vbs
    Line: 18
    Char: 29
    Error: Expected ‘Then’
    Code: 800A03F9
    Source: Microsoft VBScript compilation error

    I have two of these folders that I can’t get rid of on my computer. On installed itself under C:\Program Files on 8/13/09, and the other installed itself on my extra drive on 8/6/09. Both have the exact same folder name.

  11. Hi all,

    If you are logged into your Windows with an user other than Administrator, you have to change references do Administrator in the script to you windows user.

    If your files aren’t in c:\ volume, change it to the corresponding volume where the files are.

    If you get any errors when running the Script other than “Invalid character”, try to run the command exibited manually using windows command line.

    After I did this all, I finally could delete these files that annoyed me for so many times.

    OS: WIndows XP Home SP3.

    Thanks to Alex Verboon and everybody who helped here.

  12. I fixed the issue by _sharing_ that random-name-folder (I do “use simple file sharing” and checking “Allow network users to change my files”. Then you can delete it after getting a warning that network users may not access the folder if you delete it.

  13. Samorodok –

    this doesnt work for me. Alex script neither. i have been carrying this directory for about a year now, so i think i’ll just let it there. or reformat since it’s on another drive.

    thanks.

  14. Samorodok: thanks for your tip – although I am a fairly experienced user and can write simple programs in various languages, Alex Verboon’s script solution was a bit too complicated. It may have worked if I had tried it, but your solution was what we all needed. It works like a dream!

  15. Best and the most simple way was given by ‘Samorodok ‘
    Simply right click on the folder.Go to sharing and security.Click on the checkbox ‘Share this folder on Network’ and tick ‘Allow network users to change my files’.
    Press apply and ok.

    Now you can delete this file.When you get this warning ‘network users may not access the folder if you delete it’ simply click OK.Tried this on Win XP Home SP3.

  16. This method works very well! I am running Windows XP/SP2 and was able to delete the rouge folder this way:

    1. Disable simple file sharing
    a. In the Control Panel, Select Folder Options, then select the View Tab
    b. Scroll down to the end and uncheck the box next to “Use simple file
    sharing (Recommended)”
    c. Click Apply, OK, and exit Control Panel.

    2. Change permissions of rouge folder
    a. Navigate to the ed798b66cbeb3a7b9bde9e55a9e2 folder left behind from
    the .NET framework update
    b. Right click the folder, select Permissions, then select the Security tab
    c. Under the “Allow” column, click the first box for “Full Control”. All
    the boxes (or at least most of them) will automatically get checked.
    d. Click Apply then OK.

    3. Drag rouge folder to the Recycle Bin. This should delete without a
    problem. I told this solution to a friend and he had to go into the rouge
    folder and perform step #2 for both the folders present for some reason, but
    the end result was the same. The offending folder got deleted.

    Hope this works for you. It worked great for me!

  17. In P Professional – Simply select the files. Right click and bring up the properties dialog. Select security tab and give all rights. OK it and then delete the files.
    Simples, No ?

  18. Thank you Samorodok! Effective and very quick solution for the XP Home users among us. 🙂

  19. The network sharing with the option to allow users to delete the file worked for me on WinXP Home SP3!

    This directory took me more than six months to get rid of – and now – it’s gone!

  20. For XP Home and XP Professional users, I recommend Samorodok’s solution (15 Sept, 09)
    I use simple file sharing, as does Samorodok. I
    followed his cues and right clicked the randomly named folder and selected “Sharing and security…”. I checked “Share this folder on the network”. Then I checked “Allow Network users to change my files”. Then I deleted the entire folder (subdirectory), ignoring the warning that network users may not access the folder if you delete it.

  21. For me the following solution worked on XP Home:
    I just moved the folder into another temporary folder on the same drive. Then I was able to delete the folder. It seems the move process changes the access rights properly.

  22. Like Thomas said: Move it to My Documents and it works while it doesn’t if your leave it in root (C:)
    Thanks Samorodok

  23. Samorodok – Thank you. Worked great!

    Samorodok Says:
    September 15th, 2009 at 15:50:26
    I fixed the issue by _sharing_ that random-name-folder (I do “use simple file sharing” and checking “Allow network users to change my files”. Then you can delete it after getting a warning that network users may not access the folder if you delete it.

  24. I have Home SP3 and the sharing solution did not work. However, Dan’s solution using the program “Unlocker” worked flawlessly. Just download and install. Then right click the folder, select “Unlocker”, choose delete and then hit “ok”.

    For some reason the folder (with three other folders) got put on my second partition that I was going to use to put Win 7 on so I could dual boot until I decide to make a full switch. But because of those folders, I couldn’t reformat the partition. So thanks, Dan! Now I can get it up and running. Now I just hope XP and Win7 don’t have a problem sharing a hard drive, lol.

  25. I just used “Unlocker” one click to unlock the folder, then one click to delete it and all it’s contents

  26. Looks like there a bunch ways to do this here.
    I found another very easy way…

    1) Select all files you cannot delete
    2) Right-click >> properties >> Security >> Permissions
    3) Select “Allow” for “Full Control”
    4) OK

    Files can NOW be deleted.

  27. I have XP Home Edition SP3 and none of the sharing and permissions solutions worked for me, though I didn’t get as far as trying out the vb script.

    Marc’s suggestion on the Microsoft forum, to uncheck the box next to “Use simple file sharing (Recommended)”, didn’t work because I didn’t even have that option under “Folder Options”.

    Finally, I downloaded the Portable version of Unlocker and that worked for me (after a reboot) – Thanks Dan.

  28. Post 22 worked great. It explains how to ensure that you see the SECURITY tab when you go to the Properties of the file you are trying to delete. It then explains how to give yourself control of the file. Very easy step by step instructions which were clear and worked.

  29. Thanks for all of these posts.
    I’m not technical but tried to follow the scripting suggestions.
    I ultimately ran into all error messages listed by others.
    But when I followed the suggestion made by Samorodok on “September 15th, 2009 at 15:50:26” it worked.
    That is, I used the file sharing work-around.
    Thank you to all the posts.
    Shannon.
    Win XP Pro SP3

  30. simple for xp, create folder “temp” move to the folder, then delete it and empty the recycle bin,
    and done.

  31. In my case there were 2 issue, at first the ‘Then’ issue, there was simply missing the ” at the line:

    if ucase(objSubfolder.Name) “WINDOWS” then

    and the access denied issue could be solved with replacing the Administrator in the Everyone SID.

    REM ok this subfolder name is what I need to go after
    cmdline = fCurDir & "subinacl /subdirectories " & objSubfolder & "\*.* /setowner=S-1-1-0 /grant=S-1-1-0=F"

    Hope that will help someone.

    Sascha

  32. some problems with escaping characters 😉 hope that it fit now…

    In my case there were 2 issue, at first the ‘Then’ issue, there was simply missing the ” <> ” at the line:

    if ucase(objSubfolder.Name) <> “WINDOWS” then

    and the access denied issue could be solved with replacing the Administrator in the Everyone SID.

    REM ok this subfolder name is what I need to go after
    cmdline = fCurDir & "subinacl /subdirectories " & objSubfolder & "\*.* /setowner=S-1-1-0 /grant=S-1-1-0=F"

    Hope that will help someone.

    Sascha

  33. @Samorodok – Once again, thank you. Just had this same problem post .net framework 3.5 sp1 installation landing a temporary folder on a totally separate drive. Wish I’d spotted your solution being trying two hours worth of other attempts!

    <>

  34. in xp home… i was able to delete the folders by: Sharing the folder on the network and allowing network users to change my files..

    Then i just deleted the folder..

  35. Is there anyway to prevent these from happening? Force windows to use the %system root%\temp folder instead?

    Thanks!

Leave a Reply