-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_tree.cmd
More file actions
23 lines (21 loc) · 968 Bytes
/
list_tree.cmd
File metadata and controls
23 lines (21 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@echo off
REM List all files and folders up to 3 levels deep, excluding hidden folders (names starting with a dot),
REM and '.venv' folders. 'node_modules' folders will now be included as requested.
REM Output will be saved to tree.txt in the current directory.
REM Use PowerShell to filter out hidden (dot-prefixed) folders and .venv folders
powershell -NoProfile -Command ^
"$ErrorActionPreference = 'SilentlyContinue'; " ^
"$root = Get-Location; " ^
"Get-ChildItem -Recurse -Depth 3 | " ^
"Where-Object { " ^
" -not ( " ^
" ($_.PSIsContainer -and $_.Name.StartsWith('.')) -or " ^
" (-not $_.PSIsContainer -and $_.DirectoryName -match '(?i)[\\/]\.') -or " ^
" ($_.FullName -match '(?i)[\\/]\.venv([\\/]|$)') " ^
" )" ^
"} | " ^
"ForEach-Object { " ^
" if ($_.PSIsContainer) { 'DIR: ' + $_.FullName } else { 'FILE: ' + $_.FullName } " ^
"}" > tree.txt
echo Output saved to tree.txt
pause