Vbsedit includes all these samples. Try it now!


' Delete a Console Folder



Option Explicit

Dim objSWbemLocator
Dim objSWbemServices
Dim ProviderLoc
Dim Location
Dim objFolder


Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices= objSWbemLocator.ConnectServer _
    ("COMPUTER NAME", "root\sms")
  
Set ProviderLoc = objSWbemServices.InstancesOf("SMS_ProviderLocation")

For Each Location In ProviderLoc
        If Location.ProviderForLocalSite = True Then
            Set objSWbemServices = objSWbemLocator.ConnectServer _
                 (Location.Machine, "root\sms\site_" + Location.SiteCode)
        End If
Next

For Each objFolder in objSWbemServices.InstancesOf("SMS_ObjectContainerNode")
    if objFolder.Name="Hardware - Disk" Then
objFolder.Delete_ ' Deletes the folder - the folder items are moved back to the root node.
    End IF
Next

search for scripts


VbsEdit includes all these samples!


VbsEdit now supports .vbs, .js, .wsf and .hta scripts.
The evaluation version never expires.




Home   Scripts

Copyright © 2001-2019 adersοft