Files
disk-scanner/disk_scanner.bat
hubian 4ce1c93ad3 feat: 磁盘大文件扫描工具 v1.0.0
功能:
- 智能跳过零碎目录 (node_modules, .git, venv等)
- 文件数量阈值判断
- 大小阈值过滤
- 按大小排序展示
- 树形结构清晰展示
- 支持Windows/Linux/macOS
2026-04-12 16:22:01 +08:00

53 lines
1.3 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
:: 磁盘扫描工具 - Windows启动脚本
echo.
echo ========================================
echo 磁盘大文件扫描工具
echo ========================================
echo.
:: 检查Python
python --version >nul 2>&1
if errorlevel 1 (
echo [错误] 未找到Python请先安装Python 3.x
echo 下载地址: https://www.python.org/downloads/
pause
exit /b 1
)
:: 获取脚本所在目录
set "SCRIPT_DIR=%~dp0"
set "SCRIPT_PATH=%SCRIPT_DIR%disk_scanner.py"
:: 如果没有参数,显示使用说明
if "%~1"=="" (
echo 用法: disk_scanner.bat [目录路径] [选项]
echo.
echo 示例:
echo disk_scanner.bat .
echo disk_scanner.bat C:\Users
echo disk_scanner.bat D:\ -d 3
echo disk_scanner.bat "C:\Program Files" -f 50 -s 100M
echo.
echo 选项:
echo -d, --depth N 最大扫描深度
echo -f, --file-threshold N 文件数阈值
echo -s, --size-threshold N 大小阈值支持K/M/G
echo.
set /p "PATH_INPUT=请输入要扫描的目录路径: "
if "!PATH_INPUT!"=="" (
echo 已取消
pause
exit /b 0
)
python "%SCRIPT_PATH%" "!PATH_INPUT!"
) else (
python "%SCRIPT_PATH%" %*
)
echo.
pause