A Digital Age Deserves A Digital Leader

Remove Old Disabled Startup Entries In Msconfig (XP, Vista)

Remove Old Disabled Startup Entries In Msconfig (XP, Vista)

Postby markcynt » Wed Mar 26, 2008 8:39 am

If anyone has any entries in the msconfig startup that are still there long after the said program/s have been uninstalled then do the following. Cut n paste the info below between the lines into notepad and save it named "msconfigcleaner.vbs" (without quotes) Save as type, all files.

Then run the vbs file. You are now able to get rid of those most annoying leftover entries.


===================================================================
Set oReg = GetObject("winmgmts:!root/default:StdRegProv")
Const HKLM = &H80000002
RegKeySUF = "SOFTWARE\Microsoft\Shared Tools\MSConfig\startupfolder"
RegKeySUR = "SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg"

ResultsSUF = EnumKey(HKLM, RegKeySUF, False)
If ResultsSUF = "" Then
ResultsSUF = space(5) & "(none)"
iBtns = 0
Else
iBtns = 4
sDelPrompt = "Would you like to selectively delete any of these items?"
End If
sResults = "Disabled items in startupfolder key:" & vbcrlf & _
ResultsSUF & vbcrlf & vbcrlf

ResultsSUR = EnumKey(HKLM, RegKeySUR, False)
If ResultsSUR = "" Then
ResultsSUR = space(5) & "(none)"
If iBtns <> 4 Then iBtns = 0
Else
iBtns = 4
sDelPrompt = "Would you like to selectively delete any of these items?"
End If
sResults = sResults & "Disabled items in startupreg key:" & vbcrlf & _
ResultsSUR & vbcrlf & vbcrlf

If MsgBox(sResults & sDelPrompt, iBtns + 256) <> 6 Then WScript.quit

EnumKey HKLM, RegKeySUF, True
EnumKey HKLM, RegKeySUR, True

Function EnumKey(Key, SubKey, bDelete)
Dim Ret()
oReg.EnumKey Key, SubKey, sKeys

On Error Resume Next

ReDim Ret(UBound(sKeys))
If Err = 13 Then Exit Function
On Error GoTo 0

For Count = 0 to UBound(sKeys)
If Not bDelete Then
'this branch used on first call
Ret(Count) = space(5) & sKeys(Count)
Else
'this branch used on deletion iteration
If MsgBox("Do you want to delete " & sKeys(Count) & "?" & vbcrlf & _
vbcrlf & "This operation cannot be undone!", 4 + 256) = 6 Then
DeleteKey HKLM, SubKey & "\" & sKeys(Count)
End If
End If
Next
EnumKey = Join(Ret, vbcrlf)
End Function

Function DeleteKey(Key, SubKey)
DeleteKey = oReg.DeleteKey(Key, SubKey)
End Function

Set ws = WScript.CreateObject("WScript.Shell")
====================================================================
Velocity Micro A50
P5N-E SLI, Core2Duo E6850 @ 3.3GHZ, 2 GB DDR2 800MHZ
EVGA 8800GTS 320MB, 2x320GB Stripe, Vista Ultimate SP1, XP Pro SP3, XP Pro SP3
Arctic Cooling Freezer 7 Pro
PRO Level 6
User avatar
Posts: 208
Joined: Sun Jan 27, 2008 10:50 am
Location: Rhode Island

Return to Guides

Who is online

Users browsing this forum: No registered users and 0 guests