Jump to content

Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  yordan : (14 April 2014 - 05:28 PM) By The Way, This Could Be An Interesting Subject For A Topic, What About Posting This Question? Let's See If Other People Have The Same Feeling Concerning Bootlists!
@  yordan : (13 April 2014 - 09:36 AM) Boot Order : Cd, [Usb,] Hard Drive :D
@  yordan : (11 April 2014 - 07:23 PM) I Simply Let The Bios Do That
@  Ritesh : (11 April 2014 - 10:23 AM) Is It Possible To Launch Fedora Live Cd Or Installation Disk From Hard Drive On Windows Platform Using Grub Mbr File.
@  Ritesh : (11 April 2014 - 10:21 AM) No U Are Not.. Btw.. I Have Question For You.
@  yordan : (10 April 2014 - 08:02 AM) You Are Partially Right.
I Was Not.
Nevertheless, I Am Again :)
@  Ritesh : (09 April 2014 - 07:33 PM) :P
@  Ritesh : (09 April 2014 - 07:33 PM) I Think U R Not..
@  yordan : (09 April 2014 - 09:28 AM) I'm The Master Of The Shoutbox!
@  yordan : (05 April 2014 - 10:32 PM) He-He
@  Ritesh : (04 April 2014 - 06:59 PM) Ha Ha Ha ....
@  yordan : (04 April 2014 - 11:15 AM) Welcome Back, Starscream!
@  yordan : (03 April 2014 - 02:31 PM) And I Hope That He Will Come Back Soon :)
@  yordan : (01 April 2014 - 02:53 PM) Nice, Ritesh Came, I'm Not Home Alone Today.
@  Ritesh : (01 April 2014 - 08:51 AM) Oh!!! Poor Dear Yordan..
@  yordan : (31 March 2014 - 10:02 AM) I'm A Poor Lonesome Cow-Boy
@  yordan : (27 March 2014 - 02:22 PM) He Is Unpatient Due To His Patients!
@  Ritesh : (27 March 2014 - 10:46 AM) :(
@  Ritesh : (27 March 2014 - 10:46 AM) He Is Busy With His Patients.
@  yordan : (26 March 2014 - 08:12 PM) Ahsani, Where Are You?

- - - - -

Remove Windows Update Uninstall Information Sick of seeing NtUninstall in Windows Folder, I am

5 replies to this topic

#1 Guest_mastercomputers_*

  • Guests

Posted 14 August 2008 - 07:49 AM

Below is a script I created to remove those space taking $NtUninstall Folders from the Windows Directory as well as the entries in the Registry for them. It's not much space saving but at least it gets rid of the unnecessary scrolling that comes with it when looking in the Windows Folder.

Tested on Windows XP, Requires WScript and VBScript (which would be with most Windows OS)

$NtUninstall Folders contain the uninstall information required if you chose to remove a Windows Updated Component, I don't know anyone who needs to do this, and usually if you do, you would be required to remove it the second it's been installed because it should give you problems instantly. This script will only remove those that are present now, so if you do another Windows Update, you'll end up with newer folders so if you have problems with the new updates, least you have the option of going into Add/Remove to remove the new update. If you have no problems, you can re-use this script to remove them.

Save the script as RemoveWindowsUninstall.vbs in Notepad or any Text Editor of your choice (Not Word Processor Documents)

Option Explicit
Dim o, oShell, nConfirm
Set o = WScript.Application
o.Interactive = True
Set oShell = CreateObject("WScript.Shell")
nConfirm = oShell.Popup("Do you want to remove Windows Update Uninstall Files?", 0, "Remove Windows Update Uninstall Files", 4 + 32)
If nConfirm = 7 Then
	o.Quit 0
End If
Dim oFSO, sWinDir, oFolder, oDictionary, oSubFolder, sFolderName, sFolderPath, sUpdateName, sDeleted
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sDeleted = vbNullString
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, 12) = "$ntuninstall" And Mid(sFolderName, 13, 2) = "kb" Or Mid(sFolderName, 13, 2) = "q" Then
		sUpdateName = Mid(sFolderName, 13, Len(sFolderName) - 13)
		oDictionary.Add sUpdateName, sFolderPath
	End If
For Each sUpdateName in oDictionary.Keys
	sDeleted = sDeleted & vbCrLF & sUpdateName
	sFolderPath = oDictionary.Item(sUpdateName)
On Error Resume Next
	oShell.RegDelete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & sUpdateName & "\"
On Error Goto 0
	oShell.Run "%ComSpec% /C RD /S /Q " & Chr(34) & sFolderPath & Chr(34), 0, True
If Len(sDeleted) > 0 Then
	MsgBox "The uninstall data for the following updates are now removed:" & vbCrLf & UCase(sDeleted), vbOKOnly + vbInformation, "Files Removed"
	sDeleted = vbNullString
	MsgBox "No Windows Update Folders found for removal", vbOKOnly + vbInformation, "Nothing To Do"
End If
o.Quit 0

Just run the program, and those pesky $NtUninstalls should be gone, I know there are other folders that could be removed too, but I'll look at doing that another time, the majority is made up of these $NtUninstalls.

I will be working on other scripts to remove Temporary Files, Cookies, Prefetch, Recent and any other nonsense I come across as I need to create a very basic clean up script that does all the tasks people usually need to do if they want to get some space back. So stay tune for that.



#2 toby


    Super Member

  • Members
  • 611 posts

Posted 14 August 2008 - 11:09 AM

It's for rollbacks. Could you show some way of matching them up, so we can pick which to delete?

#3 levimage


    Premium Member

  • [HOSTED]
  • 249 posts
  • Location:United States
  • Interests:Graphics, Photography, Audio, Computers, Games, Movies, Music
  • myCENTs:50.39

Posted 14 August 2008 - 10:02 PM

This seems cool. Maybe you could make some more scripts so when it comes to backing up the os or creating images, the images will be a lot smaller. Save space and make management easier. I always try to get rid of the pagefile.sys and the hibernation file. They take up a more space now days since computer/laptops use more memory.

Good job. :mellow:

#4 LegallyHigh


    Advanced Member

  • [HOSTED]
  • 110 posts

Posted 14 August 2008 - 10:19 PM

Nice job man, I wish I knew how to script like that. The only language I have some knowledge of is HTML, and it can't be used for doing much besides creating websites.

#5 wutske


    Way Out Of Control - You need a life :)

  • [HOSTED]
  • 1,443 posts
  • Gender:Male
  • Location:Belgium
  • myCENTs:98.90

Posted 16 August 2008 - 12:27 PM

Nice script, but I think there are thousands of other programs that do the same (and I personaly prefer to remove these folders manualy, IF I remove them :mellow: ).

#6 Guest_(G)T_u_c_k_e_r_s_*

  • Guests

Posted 31 August 2010 - 01:17 AM

enhancementRemove Windows Update Uninstall Information

It would be great to display the output in a scrolling window with an acumulative total of amount of free space recovered. :)

Perhaps even an option of copying a .Reg file and the $NTUninstall folders to a network share for the ability to roll back a particular update if need be.

-reply by T_u_c_k_e_r_s


Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users