thp2008 当前离线
六级士官
@echo off echo. set /p pass=请输入当前目录下压缩文件的解压密码: set "rar=%ProgramFiles%\WinRAR\WinRAR.exe" for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p%pass% -o- "%%i" "%%~dpi"复制代码
评分人数
77七 当前离线
少校
TOP
buyiyang 当前在线
少尉
idwma 当前离线
#@&cls&powershell "type '%~0'|out-string|iex"&pause&exit $rar=$env:ProgramFiles+'\WinRAR\RAR.exe' $OutputEncoding=[System.Text.Encoding]::GetEncoding(936) $a=read-host '请输入当前目录下压缩文件的解压密码:' dir -Recurse *.rar,*.001,*.7z,*.zip|%{$a|&$rar x -y -o- $_.FullName $_.Directory}复制代码
@echo off echo 将密码复制到这里替换这行字>tsPass.txt notepad tsPass.txt set "rar=%ProgramFiles%\WinRAR\WinRAR.exe" for /f "delims=" %%a in (tsPass.txt) do ( set "pass=%%a" setlocal EnableDelayedExpansion set "pass=!pass:"=""!" for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p"!pass!" -o- "%%i" "%%~dpi" endlocal ) del tsPass.txt exit复制代码
1"@>::”#<$%"*%@“=?(*::"=*}{3"5*!!?%&|=6$”"4……-^_a=*a`~*()-_=+aa复制代码
@echo off set "rar=%ProgramFiles%\WinRAR\WinRAR.exe" for /f "delims=" %%a in ('winclip -p') do ( set "pass=%%a" setlocal EnableDelayedExpansion set "pass=!pass:"=""!" for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p"!pass!" -o- "%%i" "%%~dpi" endlocal ) pause for /f "delims=" %%a in ("1") do ( set /p pass= setlocal EnableDelayedExpansion set "pass=!pass:"=""!" for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p"!pass!" -o- "%%i" "%%~dpi" endlocal ) pause复制代码
回复 thp2008 特殊字符使用set /p ,我试了直接闪退,在7楼的代码上修改,复制后直接点脚本就行 ... 77七 发表于 2023-6-22 15:37
@echo off set "rar=%ProgramFiles%\WinRAR\WinRAR.exe" for /f "delims=" %%a in ('winclip -p') do ( set "pass=%%a" setlocal EnableDelayedExpansion set "pass=!pass:"=""!" for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p"!pass!" -o- "%%i" "%%~dpi" endlocal ) exit复制代码
setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p"!pass!" -o- "%%i" "%%~dpi"复制代码
回复 thp2008 如果你需要解压的文件的密码都是相同的,可以用那个帖子的方法 我使用那个作者提供 ... 77七 发表于 2023-6-22 13:25
@echo off set "rar=%ProgramFiles%\WinRAR\WinRAR.exe" for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do (winclip -p | "%rar%" x -y -o- "%%i" "%%~dpi") pause复制代码
@echo off set "rar=%ProgramFiles%\WinRAR\WinRAR.exe" echo. for /f "delims=" %%a in (tsPass.txt) do ( set pass=%%a setlocal EnableDelayedExpansion set pass=!pass:"=""! for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') do "%rar%" x -y -p"!pass!" -o- "%%i" "%%~dpi" endlocal ) exit复制代码
@echo off for /f "delims=" %%i in ('dir /b /s *.rar *.001 *.7z *.zip') ( winclip -p|"C:\Program Files\7-Zip\7z.exe" x "%%i" -o"%%~dpi" 1>nul ) pause复制代码