plFso = CreateObject("Scripting.FileSystemObject")
'

'
'/ 世代管理
plRoot = plFso.GetFolder(plTarbkFld)


plCurCnt = 0
For Each plSubFolder In plRoot.SubFolders '/ フォルダ数を取得
If CStr(plSubFolder.Path) <> plBackUpFolder Then
plCurCnt = plCurCnt + 1 '/ カウント
End If
Next plSubFolder
'
If plCurCnt > CInt(plTarbkCnt) - 1 Then '/ 削除が必要
For Each plSubFolder In plRoot.SubFolders '/ フォルダをエントリー順に
If CStr(plSubFolder.Path) <> plBackUpFolder Then
Call plFso.DeleteFolder(plSubFolder, True) '/ フォルダ削除
End If
plCurCnt = plCurCnt - 1
If plCurCnt <= CInt(plTarbkCnt) - 1 Then
Exit For
End If
Next plSubFolder
End If
'
'/ バックアップフォルダ作成
If plFso.FolderExists(plBackUpFolder) = False Then
Call plFso.CreateFolder(plBackUpFolder)
End If

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-12-12
  • 2021-11-17
  • 2022-12-23
  • 2022-03-05
猜你喜欢
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案