Код:
Option Explicit
Dim objShell
Dim objFolderItem, objFolderItem2
Dim objVerb
Set objShell = WScript.CreateObject("Shell.Application")
For Each objFolderItem In objShell.NameSpace(&H11).Items
WScript.Echo "[" & objFolderItem.Name & "]"
If StrComp(objFolderItem.Name, "Redmi Note 4", vbTextCompare) = 0 Then
For Each objFolderItem2 In objFolderItem.GetFolder.Items
WScript.Echo vbTab & "[" & objFolderItem2.Name & "]"
If StrComp(objFolderItem2.Name, "Внутренний общий накопитель", vbTextCompare) = 0 Then
With objFolderItem2.GetFolder.ParseName("Sample")
WScript.Echo vbTab & vbTab & "[" & .Name & "]"
With .GetFolder
With .ParseName("SampleFolder")
WScript.Echo vbTab & vbTab & vbTab & "[" & .Name & "]"
For Each objVerb In .Verbs
If StrComp(objVerb.Name, "&Удалить", vbTextCompare) = 0 Then
WScript.Echo vbTab & vbTab & vbTab & vbTab & "[" & objVerb.Name & "]"
'objVerb.DoIt
Exit For
End If
Next
End With
With .ParseName("Sample.txt")
WScript.Echo vbTab & vbTab & vbTab & "[" & .Name & "]"
For Each objVerb In .Verbs
If StrComp(objVerb.Name, "&Удалить", vbTextCompare) = 0 Then
WScript.Echo vbTab & vbTab & vbTab & vbTab & "[" & objVerb.Name & "]"
'objVerb.DoIt
Exit For
End If
Next
End With
End With
End With
Exit For
End If
Next
Exit For
End If
Next
Set objShell = Nothing
WScript.Quit