Joakim was trying to slug through the ConfigMgr 2007 “delete wizard” to remove multiple packages, but because there were so many packages to remove the process was slow, tedious, and almost painful.
Sherry Kissinger recommended example 4-4 from the most excellent and valuable SMS 2003 Recipes book (many of the scripts are still applicable for ConfigMgr 2007) and Joakim’s issue was on the way to resolved.
Joakim’s solution:
This is how I solved it.
Using the script from SMS 2003 Recipes and just add code to import from a csv-file I was able to do the removal. The code for the script can be found below.
Thanks Sherry for the tip about the script in book
‘ ————————————————————————————————–
‘
‘ Edit the line with strSMSServer with your SCCM server hostname.
‘ Create a csv file with all the packageID:s you wants to remove, seperate them with a semicolon.
‘ Run the Delete_Packages.vbs
‘
‘ Remove the ‘ from " ‘wscript.echo "Deleted " & strPackageID " if you want to display a messagebox
‘
‘ ————————————————————————————————–
dim fs,objTextFile
set fs=CreateObject("Scripting.FileSystemObject")
dim arrStr
dim x
dim y
x = 0
y = 0
set objTextFile = fs.OpenTextFile("delete_packages.csv")
Do while NOT objTextFile.AtEndOfStream
arrStr = split(objTextFile.ReadLine,";")
Loop
objTextFile.Close
set objTextFile = Nothing
set fs = Nothing
For Each package In arrStr
strSMSServer = "SCCMSERVER"
on error resume next
strPackageID = package
Set objLoc = CreateObject("WbemScripting.SWbemLocator")
Set objSMS= objLoc.ConnectServer(strSMSServer, "root\sms")
Set Results = objSMS.ExecQuery _
("SELECT * From SMS_ProviderLocation WHERE ProviderForLocalSite = true")
For each Loc in Results
If Loc.ProviderForLocalSite = True Then
Set objSMS = objLoc.ConnectServer(Loc.Machine, "root\sms\site_" & _
Loc.SiteCode)
strSMSSiteCode = Loc.Sitecode
end if
Next
‘Remove Package
Set objPackage = GetObject( "WinMgmts:\\" & strSMSServer & _
"\root\SMS\site_" & strSMSSiteCode & _
":SMS_Package.PackageID=’" & strPackageID & "’")
objPackage.Delete_
‘wscript.echo "Deleted " & strPackageID
Next
Original post: http://www.myitforum.com/forums/tm.aspx?m=233655

Rod Trent: That happens. Its a false positive because there are scripts in the zi...
Tim: Virus detected for the Right Click Tools Link!!...
Fandangoed up the river: Is there any way to have one shortcut to combine both of those menu ...
Ian Pickering: Sure is an option Scott - of course it has a reliance on your SCCM 200...
Carl: Hi rick, how do I uninstall these tools. The collection actions aren't...