Command Prompt output to CSV

35,180

Try this:

forfiles /s /C "cmd /c echo @file, @fdate, @ftime, @isdir" > MyTextOutput.csv

You are telling the OS what to output, just tell it to output commas too.

Share:
35,180

Related videos on Youtube

BobJim
Author by

BobJim

Updated on September 18, 2022

Comments

  • BobJim
    BobJim over 1 year

    I'm using the forfiles command to list files and folders (included sub folders) which is piped to a text file. My subsequent process requires this output to be in comma delimited format (.csv).

    This is the script I'm currently using and would like to update:

    forfiles /s /C "cmd /c echo @file @fdate @ftime @isdir" > MyTextOutput.txt

    Is it possible to send the output from the forfiles command to a .csv file?