exceluser

Inhaltsverzeichnis aller Dateien mit aktuellem Datum in eine Textdatei speichern

Suche eine Lösung als Batch Variante:

Hallo,

ich habe folgendes Problem,

ich möchte im Inhaltsverzeichnis X: alle *.BAK und *.CSV Dateien mit dem aktuellen Systemdatum als Liste in eine Textdatei speichern.

momentan verwende ich: dir *.bak *.csv /B >LISTE.TXT

Vielen Dank im Voraus für eure Hilfe!
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 137206

Url: https://administrator.de/forum/inhaltsverzeichnis-aller-dateien-mit-aktuellem-datum-in-eine-textdatei-speichern-137206.html

Ausgedruckt am: 25.04.2025 um 08:04 Uhr

Snowman25
Snowman25 02.03.2010 um 14:52:02 Uhr
Goto Top
Sehe kein Problem. Frage gibts auch keine.
für alles weitere:
RTFM!
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

U:\>dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
  [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

  [drive:][path][filename]
              Specifies drive, directory, and/or files to list.

  /A          Displays files with specified attributes.
  attributes   D  Directories                R  Read-only files
               H  Hidden files               A  Files ready for archiving
               S  System files               -  Prefix meaning not
  /B          Uses bare format (no heading information or summary).
  /C          Display the thousand separator in file sizes.  This is the
              default.  Use /-C to disable display of separator.
  /D          Same as wide but files are list sorted by column.
  /L          Uses lowercase.
  /N          New long list format where filenames are on the far right.
  /O          List by files in sorted order.
  sortorder    N  By name (alphabetic)       S  By size (smallest first)
               E  By extension (alphabetic)  D  By date/time (oldest first)
               G  Group directories first    -  Prefix to reverse order
  /P          Pauses after each screenful of information.
  /Q          Display the owner of the file.
  /S          Displays files in specified directory and all subdirectories.
  /T          Controls which time field displayed or used for sorting
  timefield   C  Creation
              A  Last Access
              W  Last Written
  /W          Uses wide list format.
  /X          This displays the short names generated for non-8dot3 file
              names.  The format is that of /N with the short name inserted
              before the long name. If no short name is present, blanks are
              displayed in its place.
  /4          Displays four-digit years

Switches may be preset in the DIRCMD environment variable.  Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

U:\>

Siehe besonders:
/S Displays files in specified directory and all subdirectories.
bastla
bastla 02.03.2010 um 16:30:21 Uhr
Goto Top
Hallo Exceluser und willkommen im Forum!

Sollte sich etwa so lösen lassen:
@echo off & setlocal
set "Ordner=X:\"  
set "Liste=D:\Liste.txt"  

del "%Liste%" 2>nul  
pushd "%Ordner%"  
for /f "delims=" %%i in ('dir /s /b *.bak *.csv') do echo %%~ti|findstr /b "%date%">nul && >>"%Liste%"echo %%i  
popd
Grüße
bastla