Skip to content

Instantly share code, notes, and snippets.

@zelenko
Last active December 13, 2017 19:53
Show Gist options
  • Save zelenko/0c6958e87789cc73b6adffbd861f0e6a to your computer and use it in GitHub Desktop.
Save zelenko/0c6958e87789cc73b6adffbd861f0e6a to your computer and use it in GitHub Desktop.
How to list all files on C drive?
# https://gistlog.co/zelenko/0c6958e87789cc73b6adffbd861f0e6a
published: true
include_files: true
preview: This batch script will save all the files and folders to a text file. All files and folders will be listed, including hidden and system files and folders.

On Widows this batch file will export to text file a full list of files and directories on the C drive.

@ECHO OFF

SET dd=%DATE:~7,2%
SET mm=%DATE:~4,2%
SET yyyy=%DATE:~10,4%
SET hh=%TIME:~0,2%
IF "%hh:~0,1%"==" " SET hh=0%hh:~1,1%
SET mn=%TIME:~3,2%
SET ss=%TIME:~6,2%
set file=%yyyy%-%mm%-%dd%_%hh%-%mn%-%ss%_STUDIO_C-DRIVE.txt

echo Creating Regular list...
echo ==Regular Files== >> %file%
dir c:\ /s/b >> %file%

echo Creating Hidden list...
echo ==Hidden Files== >> %file%
dir c:\ /A:h-s /s/b >> %file%

echo Creating System list...
echo ==System Files== >> %file%
dir c:\ /A:s /s/b >> %file%

echo Creating Directory list...
echo ==Directories== >> %file%
dir c:\ /A:d /s/b >> %file%
@ECHO OFF
SET dd=%DATE:~7,2%
SET mm=%DATE:~4,2%
SET yyyy=%DATE:~10,4%
SET hh=%TIME:~0,2%
IF "%hh:~0,1%"==" " SET hh=0%hh:~1,1%
SET mn=%TIME:~3,2%
SET ss=%TIME:~6,2%
set file=%yyyy%-%mm%-%dd%_%hh%-%mn%-%ss%_STUDIO_C-DRIVE.txt
echo Creating Regular list...
echo ==Regular Files== >> %file%
dir c:\ /s/b >> %file%
echo Creating Hidden list...
echo ==Hidden Files== >> %file%
dir c:\ /A:h-s /s/b >> %file%
echo Creating System list...
echo ==System Files== >> %file%
dir c:\ /A:s /s/b >> %file%
echo Creating Directory list...
echo ==Directories== >> %file%
dir c:\ /A:d /s/b >> %file%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment