复制代码
- @echo off&setlocal enabledelayedexpansion
- ::Batch Resource Management Program V1.0.1
- set "input=%1"
- set "rmppath=%~dp0"
- set H1=%rmppath%
- :rmpMenuPreview 控制台
- cls
- title %cd%
- set rmpvar=
- echo;历史记录:!H1! !H2! !H3!
- echo;=============================================================================
- ::echo;打开【O】新建【W】删除【D】重命名【M】属性【R】创建快捷方式【S】关闭【C】
- ::echo;编辑【】剪切【】复制【】粘贴【】移动【】
- ::echo;查看【】图标【】排列【】刷新【】选择【】搜索【】查看【】收藏【】设置【】
- echo;定位【PS】历史记录【H】帮助【Help】
- echo;=============================================================================
- set num=0
- for /f "tokens=*" %%a in ('dir /b') do set /a num+=1&echo; !num! %%a&set "rmpvar=%%a"
- if "!rmpvar!"=="" echo; ^<空文件夹^>
- echo;
- set input=
- set inputs=
- set /p "input= 请输入:"
- if "%input%"=="" goto rmpMenuPreview
- if exist "%input%" cd /d "%input%"&call :rmpHistory "%input%"
- if /i "%input%"=="Help" call :rmpHelp&goto rmpMenuPreview
- if /i "%input:~0,1%"=="H" if "%input:~2,2%"=="" call :rmpHistoryBack&goto rmpMenuPreview
- for /f "tokens=1,2" %%a in ("%input%") do if "%%b"=="" (set input=%%a) else (set input=%%a&set inputs=%%b)
- echo;
- call :rmpLinePosition
- echo;
- echo;=============================================================================
- echo; ^<The End^>
- pause>nul
- goto rmpMenuPreview
- :rmpLinePosition 处理类型
- set num=0
- for /f "tokens=*" %%a in ('dir /b') do set /a num+=1&if !num!==!input! (
- echo; !num! "%%~a"
- echo;=============================================================================
- if exist "%%~a" (
- if /i %%~xa==.txt more "%%~a"
- if /i %%~xa==.bat more "%%~a"
- if /i %%~xa==.cmd more "%%~a"
- if exist "%%~a" (
- dir /b /a:d "%%~a">nul 2>nul&&((cd /d "%%~a"&call :rmpHistory "%cd%\%%~a"&if not "!inputs!"=="" call :rmpOperationOption "%cd%\%%~na")&goto rmpMenuPreview)||(if not "!inputs!"=="" (call :rmpOperationOption "%cd%\%%~a") else (start "" "%%~a"))
- )
- ) else echo; "%%~a"
- )
- goto :eof
- :rmpOperationOption 操作设置
- echo "%cd%" "%~1"
- if /i "!inputs!"=="PS" Explorer /select,"%~1"
- goto :eof
- :rmpHelp 帮助信息
- cls
- echo;=============================================================================
- echo;
- echo; 基本用法:输入命令或序号执行相应内容
- echo; 复合操作【数字+操作】如定位:5 PS
- echo; 历史操作【H】如:H2
- echo;
- echo;=============================================================================
- pause>nul
- goto :eof
- :rmpHistory 历史记录项目设置
- for /f %%a in ("%1") do (
- set H9=!H8!
- set H8=!H7!
- set H7=!H6!
- set H6=!H5!
- set H5=!H4!
- set H4=!H3!
- set H3=!H2!
- set H2=!H1!
- set H1=%%~a
- )
- goto :eof
- :rmpHistoryBack 获得历史记录内容
- set num=0
- if /i "!input!"=="H" (
- echo;&echo;&echo; 历史记录:
- echo; 0 %rmppath% ^<本程序位置^>
- )
- for /l %%a in (1,1,9) do (
- set /a num+=1
- if /i "!input!"=="H" echo; !num! !H%%a!
- if /i !input!==H%%a cd /d !H%%a!&goto :eof
- )
- echo;
- set num=0
- set input=
- set /p "input= 请输入:"
- if /i "!input!"=="" goto rmpMenuPreview
- for /l %%a in (1,1,9) do (
- set /a num+=1
- if /i !input!==0 cd /d %rmppath%&goto :eof
- if /i !input!==%%a cd /d !H%%a!&goto :eof
- )
- goto rmpMenuPreview
- tree /f
- pause
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |