Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Update > Removing UninstallKB's from the Winnt directory

Reply
Thread Tools Display Modes

Removing UninstallKB's from the Winnt directory

 
 
Jim in Cleveland
Guest
Posts: n/a

 
      10-24-2005
I'm trying to recoup some space off my C: drive. Looked in the Winnt
directory and I see a large number of $NtUnistallKB*folders. Can I remove
these without any repercussions? Things have been going smoothly so I don't
think I'm going to be rolling back any of the updates? Or, can I just move
these to another drive?

Thanks,

Jim
 
Reply With Quote
 
 
 
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      10-24-2005
Jim in Cleveland wrote:

> I'm trying to recoup some space off my C: drive. Looked in the Winnt
> directory and I see a large number of $NtUnistallKB*folders. Can I remove
> these without any repercussions? Things have been going smoothly so I don't
> think I'm going to be rolling back any of the updates? Or, can I just move
> these to another drive?
>

Hi,

As long as you doesn't care about not being able to uninstall the
updates anymore, all the $ntuninstall... folders can be deleted.

Below is a VBScript (put it in a .vbs file) that I have written that
will remove the uninstall folder (and the Add/Remove Programs entry
if one exists) for all hotfixes that creates $ntuninstall... folders
under the Windows folder.

Note: This will not uninstall the update itself, only the
uninstall folder and the Add/Remove Programs entry.


'--------------------8<----------------------

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
Set oFolder = oFSO.GetFolder(sWinDir)
Set oDictionary = CreateObject("Scripting.Dictionary")

For Each oSubFolder In oFolder.SubFolders

sFolderName = LCase(oSubFolder.Name)
sFolderPath = LCase(oSubFolder.Path)

If Left(sFolderName, 13) = "$ntuninstallq" _
Or Left(sFolderName, 14) = "$ntuninstallkb" Then

' get the update name for the registry delete
sUpdateName = Mid(sFolderName, 13, Len(sFolderName) - 13)

' never delete folders/files while enumerating a file/folder collection
' adds them to a dictionary object for later handling instead
oDictionary.Add sUpdateName, sFolderPath

End If
Next

sDeleted = ""
For Each sUpdateName In oDictionary.Keys

sDeleted = sDeleted & vbCrLf & sUpdateName
sFolderPath = oDictionary.Item(sUpdateName)

On Error Resume Next
' remove entry in Add/Remove Programs
oShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows\" _
& "CurrentVersion\Uninstall\" & sUpdateName & "\"
On Error Goto 0

' delete the uninstall folder
oShell.Run "%Comspec% /C RD /S /Q " _
& Chr(34) & sFolderPath & Chr(34), 0, True
Next

If sDeleted <> "" Then
MsgBox "The uninstall data for the following updates are now removed:" _
& vbCrLf & UCase(sDeleted)
Else
MsgBox "No updates found to remove the uninstall data for."
End If

'--------------------8<----------------------



--
torgeir, Microsoft MVP Scripting, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      10-25-2005
Allen L. wrote:

> Torgeir Bakken (MVP) <Torgeir.Bakken-> typed:
>
>>
>>As long as you doesn't care about not being able to uninstall the
>>updates anymore, all the $ntuninstall... folders can be deleted.
>>
>>
>>>bottom snipped<<

>
>
> What about the the 'top' hidden folder that is right above the $ntuninstall
> folders? I've been deleting it also. Since I don't presently have it, but
> seems it's named something like "updis" and is not compressed, but contained
> the same MS updates that I deleted in hidden format. After deleting the
> compressed updates, the "updis" folder is still many MB in size. Of course
> on the next update, the "updis" (or whatever it is named) is re-created
> along with the compressed updates again.
>

Hi,

I would think you mean the $hf_mig$ folder.

You should not delete the content in the folder $hf_mig$.

More about the $hf_mig$ folder in this KB article:
http://support.microsoft.com/default...b;en-us;824994


--
torgeir, Microsoft MVP Scripting, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      10-25-2005
Allen L. wrote:

> Torgeir Bakken (MVP) <Torgeir.Bakken-> typed:
>
>>Hi,
>>
>>I would think you mean the $hf_mig$ folder.
>>
>>You should not delete the content in the folder $hf_mig$.
>>
>>More about the $hf_mig$ folder in this KB article:
>>http://support.microsoft.com/default...b;en-us;824994

>
>
> I read the article you posted and can see basically what the $hf_mig$ folder
> does, but since I've been deleting the folder for some time now and can't
> recover the info lost, what will occur with the new updates? Should I just
> from now on *not* delete the folder?


Yes, I suggest you do not delete the folder in the future.


> Reason I ask, if by doing the deleting
> in the past, have I already totally 'messed' up the update features of some
> of the files that *would* have been overwritten? My OS seems to function OK,
> and it would appear I have no repair type option to try and perform do I?


Do not worry, your computer should be OK. The main role for the
$hf_mig$ is to keep security updates in place when installing or
uninstalling OS service pack. Assuming you have SP2 installed, and
you need to uninstall SP2 for some reason, because you have deleted
the $hf_mig$, the SP uninstall will not be able to migrate the
updates you have installed since SP2 was installed. A trip to the
Windows Update will fix this, as it will see that the updates are not
installed anymore, and offer the updates to you.


> How about running CHKDSK from the command option? Would that sort any 'bad'
> files out?


No.

>
> One extra question, if I may. When running CHKDSK through the user interface
> and not using the options (leaving the fix and repair blanks unchecked) or
> running CHKDSK in command mode with no options such as " /F" , does it
> really do any good on the active partition that is in use? Should CHKDSK
> always be used with the options checked if using the 'tools' section of the
> hard disk and also the command "/F" way to run the program?
>


I do not have any deep understanding of the difference in the two ways
to run CHKDSK, so I leave that question to be answered by someone else
if they see it.


--
torgeir, Microsoft MVP Scripting, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a

 
      10-25-2005
Allen L. wrote:

>>>>Allen L. wrote:
>>>>
>>>>What about the the 'top' hidden folder that is right above the
>>>>$ntuninstall folders? I've been deleting it also. Since I don't
>>>>presently have it, but seems it's named something like "updis" and
>>>>is not compressed, but contained the same MS updates that I deleted
>>>>in hidden format. After deleting the compressed updates, the "updis"
>>>>folder is still many MB in size. Of course on the next update, the
>>>>"updis" (or whatever it is named) is re-created along with the
>>>>compressed updates again.
>>>
>>>In news:%,

>>
>>Torgeir Bakken (MVP) <Torgeir.Bakken-> typed:
>>
>>>Hi,
>>>
>>>I would think you mean the $hf_mig$ folder.
>>>
>>>You should not delete the content in the folder $hf_mig$.
>>>
>>>More about the $hf_mig$ folder in this KB article:
>>>http://support.microsoft.com/default...b;en-us;824994

>>
>>In news:eaq7f.23777$,

>
> Allen L. <> typed:
>
>
>>I read the article you posted and can see basically what the $hf_mig$
>>folder does, but since I've been deleting the folder for some time
>>now and can't recover the info lost, what will occur with the new
>>updates? Should I just from now on *not* delete the folder? Reason I
>>ask, if by doing the deleting in the past, have I already totally
>>'messed' up the update features of some of the files that *would*
>>have been overwritten? My OS seems to function OK, and it would
>>appear I have no repair type option to try and perform do I? How
>>about running CHKDSK from the command option? Would that sort any
>>'bad' files out?
>>One extra question, if I may. When running CHKDSK through the user
>>interface and not using the options (leaving the fix and repair
>>blanks unchecked) or running CHKDSK in command mode with no options
>>such as " /F" , does it really do any good on the active partition
>>that is in use? Should CHKDSK always be used with the options checked
>>if using the 'tools' section of the hard disk and also the command
>>"/F" way to run the program?
>>Thanks for the reply,
>>
>>...Allen

>
>
> One extra question, please. Would running "sfc /scannow" from the command
> prompt help me in anyway in the above folder deleting error?
>


No.


--
torgeir, Microsoft MVP Scripting, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Uninstall not removing directory PsyberFox Windows Vista General Discussion 4 12-16-2008 06:55 PM
Setting up a directory and moving a file into that directory from gppnrdrj Windows Vista General Discussion 4 07-11-2007 12:06 PM
Setting up a directory and moving a file into that directory from gppnrdrj Windows Vista General Discussion 1 07-11-2007 08:31 AM
Is the WINNT directory used in vista nicholas gadacz Windows Vista Installation 3 05-01-2007 01:20 AM
Removing \winnt\$NtUninstall* & \winnt\ServicePackFiles? Gaikokujin Kyofusho Windows Update 1 03-02-2004 03:23 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59