Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: dir on comand prompt  (Read 3370 times)

0 Members and 1 Guest are viewing this topic.

forumarbeit

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 7
    dir on comand prompt
    « on: May 06, 2017, 03:36:15 AM »
    Hi,
    I would like list all directories, subdirectories and files as well as the last access date, time and filesize of the HDD recursive in a text file.
    how can i do this?

    sample:
    06.05.2017  10:41          4.204.274    C:\Test\test.exe
    14.09.2015  15:32               24.068    C:\Test1\Sample1\test.txt
    22.07.2016  06:55      114.204.158    C:\Test2\Sample1\test.jpg
    ...
    ...
    or
    C:\Test\test.exe                         4.204.274     06.05.2017  10:41   
    C:\Test1\Sample1\test.txt               24.068    14.09.2015  15:32
    C:\Test2\Sample1\test.jpg     114.204.158    22.07.2016   06:55
    ...
    ...


    I have try it with  dir commad but i can not use correct the parameter  for this output like the sampe.

    thanks for your help

    Hackoo



      Hopeful
    • Thanked: 42
    • Experience: Expert
    • OS: Windows 10
    Re: dir on comand prompt
    « Reply #1 on: May 06, 2017, 07:48:22 AM »
    Hi  ;)
    You should take a look at this link ==> https://ss64.com/nt/dir.html
    This an example to show you how to list folders and files in your temporary folder :
    List_Foders_Files.bat
    Code: [Select]
    @echo off
    Set "MasterFolder=%Temp%"
    set "TmpFile=%tmp%\%~n0.txt"
    set "LogFile=List_Folders_Files.txt"
    Dir %MasterFolder% /A /R /S /O:S /T:A > "%TmpFile%"
    CMD /U /C Type "%TmpFile%" > "%LogFile%"
    Start "" "%LogFile%"