1.

Solve : Long List?

Answer»

Hello,

I would like to know how to CREATE a batch that creates a list of all the files in the COMPUTER then write it in a txt file.

Thanks

Almnalmn,

The easy solution is:

@DIR /b /s C:\>List.txt

A more sophisticated solution can be found at [highlight]http://dostips.cmdtips.com/DtCodeBatchFiles.php[/highlight] under "[highlight]List of all Files[/highlight]":

Code: [Select]@REM....&SETLOCAL ENABLEEXTENSIONS&SETLOCAL DISABLEDELAYEDEXPANSION
@REM....&set /p s=FileSearch, type '-' to refresh LOOKUP list: ||GOTO:EOF
@REM....&if .%s% NEQ .- echo.&findstr %s% "%~f0"&PAUSE&GOTO:EOF
@REM....&findstr /b /c:"@REM....&" "%~f0">"%~f0.txt"
@REM....&dir /s/b c:\ 1>>"%~f0.txt"&move /Y "%~f0.txt" "%~f0"
@REM....&GOTO:EOF
This batch appends a list of all files to the batch file itself and allows you to search the content or refresh the list afterwards.

8-)
Thank You, It works very WELL



Discussion

No Comment Found