In My Folder there are a lot of files are stored , i want get only yesterday file names into excel sheet based on current date time ...so i can see all files names which are modified yesterday
using batch script
I tried hard but not getting Excpected output
Current Status: its show me all files name into excel sheet
Requirement:- Need to show yesteday files name into excel sheet
here is my code ......
- @echo off
- setlocal
- rem Define folder to scan, and output file for CSV results
- set BaseDir=E:\X\
- set OutputFile=Archive.csv
- (
- rem Write column headers to output file
- echo "Doc Name"," ","File Type","Modified Date","File Path"
- rem Process all files in all folders under base folder
- for /f "tokens=*" %%I in ('dir /s/b/a-d "%BaseDir%"') do (
- rem Write file data to output file
- echo "%%~nI","","%%~xI",%%~tI,"%%~dpI"
- )
- )> "%OutputFile%"
- rem Open output CSV file in Excel for analysis
- start excel "%OutputFile%"
- rem Define folder to scan, and output file for CSV results
- set BaseDir=E:\V\
- set OutputFile=XBDArchive.csv
- (
- rem Write column headers to output file
- echo "Doc Name"," ","File Type","Modified Date","File Path"
- rem Process all files in all folders under base folder
- for /f "tokens=*" %%I in ('dir /s/b/a-d "%BaseDir%"') do (
- rem Write file data to output file
- echo "%%~nI","","%%~xI",%%~tI,"%%~dpI"
- )
- )> "%OutputFile%"
- rem Open output CSV file in Excel for analysis
- start excel "%OutputFile%"
- start "" /wait cmd /c "echo Opeartion Sucessful done !&echo(&pause"