Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VBS - Löschscript

Empfohlene Antworten

Hi.

Hat jemand von euch ein VBS Script das mir alle Dateien in einem Ordner löscht die älter als 2 Tage sind ?

Oder einen Link zu so einem Script wäre auch supi :)

Bin für jede Hilfe dankbar....

Anpassen kann ich es selber, bräuchte nur etwas das Dateien löscht die einen bestimmten Zeitspanne nicht mehr angefasst wurden.

Also als kleine Denkhilfe das ganze in VB6:

Private Sub DeleteFiles()


  Dim vFSO As FileSystemObject

  Dim vFolder As Folder

  Dim vFile As File

  Set vFSO = New FileSystemObject

  Set vFolder = vFSO.GetFolder("C:\TEMP")


  For Each vFile In vFolder.Files

    If vFile.DateCreated > "18.11.2003" Then 'ich finde den Cast nicht, der fehlt natürlich noch

      vFile.Delete

    End If

  Next


End Sub
Nachtrag in VBS:
  Dim vFSO, vFolder, vFile

  Set vFSO = CreateObject("Scripting.FileSystemObject")

  Set vFolder = vFSO.GetFolder("C:\TEMP")


  For Each vFile In vFolder.Files

    If vFile.DateCreated > "18.11.2003" Then 'ich finde den Cast nicht, der fehlt natürlich noch

      vFile.Delete

    End If

  Next

Das funzt ;)

Hier habe ich das Datum selbst eingegeben, man kann natürlich auch das Datum automatisch auf sysdate - 2d setzen (keine Ahnung wie ;) )

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.