艦これ2024早春イベお疲れ様でした)、たまに えびバイク など




スクリプト

不要なファイルとフォルダを自動的に削除するスクリプトを作ってみた。


'WindowsUpdateで使用した、不要なファイルとフォルダを削除する

strFolderName = "C:\WINDOWS\SoftwareDistribution\Download\"
Set objShell = WScript.CreateObject("Shell.Application")
objShell.Explore strFolderName
Set objFs = CreateObject("Scripting.FileSystemObject")
Set objFolder = objShell.NameSpace(strFolderName)
Set objFolderItems = objFolder.Items()
For i=0 To objFolderItems.Count-1
Set objItem = objFolderItems.Item(i)
If objItem.IsFolder = True Then
objFs.DeleteFolder strFolderName & objItem.Name
Else
objFs.DeleteFile strFolderName & objItem.Name
End If
Next