set regg=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer
set "_work=%~dp0"
if "%_work:~-1%"=="" set "_work=%_work:~0,-1%"
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "Desktop"') do set Current_Desktop=%%b
if %Current_Desktop% EQU %_work% mshta vbscript:CreateObject("Wscript.Shell").popup("请勿在桌面运行此脚本!",5,"提示",64)(window.close)&&exit
for /f "tokens=3" %%i in ('wmic logicaldisk where DriveType^=3 Get FileSystem^,FreeSpace^,Name^,Size^|findstr ":"') do if not %%i==%SystemDrive% set Name=%%i !Name!
set choice=!Name!
for %%i in (%choice%) do if exist %%i\nul if not exist "%%i\Windows\explorer.exe" set drive=%%i
if "%drive%"=="." mshta vbscript:CreateObject("Wscript.Shell").popup("没有发现可用驱动器!",4,"错误",64)(window.close)&&exit
set CopyFile=N
set DelFile=N
if "%2" NEQ "" call :config %2
set HP=\Users\%USERNAME%
if /i "%1"=="/u" goto default
echo 正在检测系统,请稍候...
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "{4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4}"') do set Current_Saved_Games=%%b
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "{56784854-C6CB-462B-8169-88E350ACB882}"') do set Current_Contacts=%%b
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "{BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968}"') do set Current_Links=%%b
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "{7D1D3A04-DEBB-4115-95CF-2F29DA2920DA}"') do set Current_Searches=%%b
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "Favorites"') do set Current_Favorites=%%b
for /f "tokens=3*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "My Video"') do set Current_My_Video=%%b
for /f "tokens=3*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "My Pictures"') do set Current_My_Pictures=%%b
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "Personal"') do set Current_Personal=%%b
for /f "tokens=3*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "My Music"') do set Current_My_Music=%%b
for /f "tokens=2*" %%a in ('REG QUERY "%regg%\Shell Folders" /v "{374DE290-123F-4565-9164-39C4925E467B}"') do set Current_Downloads=%%b
if defined doj (
for /f "skip=2 tokens=2*" %%a in ('REG QUERY "%regg%\User Shell Folders" /v "{31C0DD25-9439-4F12-BF41-7FF4EDA38722}"') do set Current_Objects=%%b
)
if "%1" EQU "" goto input
set conf=%1
call :cap %conf% conf
echo %choice%|findstr /ic "%conf%">nul 2>nul
if %errorlevel% NEQ 0 mshta vbscript:CreateObject("Wscript.Shell").popup("驱动器不存在!",3,"错误",64)(window.close)&&exit
set Drive_Letter=%conf%
set REG_EX=%Drive_Letter%%HP%
goto auto
:input
cls
echo %Def%当前文件夹位置:
echo.
echo.『我的文档』 %_dBlue%%Current_Personal%%Def%
echo.『桌面』 %_dBlue%%Current_Desktop%%Def%
echo.『下载』 %_dBlue%%Current_Downloads%%Def%
echo.『收藏夹』 %_dBlue%%Current_Favorites%%Def%
echo.『我的图片』 %_dBlue%%Current_My_Pictures%%Def%
echo.『我的视频』 %_dBlue%%Current_My_Video%%Def%
echo.『我的音乐』 %_dBlue%%Current_My_Music%%Def%
echo.『保存的游戏』 %_dBlue%%Current_Saved_Games%%Def%
echo.『联系人』 %_dBlue%%Current_Contacts%%Def%
echo.『链接』 %_dBlue%%Current_Links%%Def%
echo.『搜索』 %_dBlue%%Current_Searches%%Def%
if defined doj (echo.『3D 对象』 %_dBlue%%Current_Objects%%Def%)
echo.%_Green%
echo. U 还原默认
echo. Q 退出
echo.%_Yellow%
set Drive_Letter=%drive%
set /P Drive_Letter="请输入目标驱动器(默认值:%drive%) [%choice%] "