打包.bat
2019-12-28 11:13:40 720
  • 收藏

    @echo off

    REM ======================================================================REM

    REM  

    REM

    REM NAME: 批量加密打包单个文件,并生成对应密码表

    REM

    REM AUTHOR: hitme ,REM DATE  : 2009-04-16REM

    REM COMMENT: 密码由随机数字组成,长度与文件名长度相同

    REM

    REM ======================================================================@echo off:repare

    del ws-lfcn.txt tmp.txt 2>nul

    md www.ws-lf.cn 2>nul



    setlocal ENABLEDELAYEDEXPANSION:input

    echo.set /p input=加密打包文件还是文件夹^(F=文件,D=文件夹,A=全部^)echo.if /i "%input%"=="f" (set key=/aa) else (

                                            if /i "%input%"=="d" (set key=/ad) else (

                                                                                                                            if /i "%input%"=="a" (set key=) else goto :input)):codefor /f "delims=" %%i in ('dir %key%/b^|findstr /v "%~nx0 www.ws-lf.cn"') do (

                                                    echo.%%i>tmp.txt

                                                    echo. >>tmp.txt                                                for /f "delims=:" %%a in ('findstr /o "." tmp.txt') do (

                                                            set /a len=%%a - 2

                                                    )

                                                    set m=

                                                    for /l %%l in (1,1,!len!) do (

                                                            echo %random% >nul

                                                            set  m=!m!!random:~-1!

                                                    )

                                                    echo %%i:!m!>>ws-lfcn.txt

                                                    del tmp.txt>nul                                               

    )endlocal:www.ws-lf.cn

    setlocal

    set path=%path%;c:\program files\winrarif exist ws-lfcn.txt (

                                    for /f "tokens=1* delims=:" %%i in (ws-lfcn.txt) do rar a -p%%j "www.ws-lf.cn\%%~ni.rar" "%%i"

                                    move ws-lfcn.txt www.ws-lf.cn

                                    start www.ws-lf.cn) else echo...未能打包 & pause

    endlocal


    上一页:windows重启资源管理器.bat 下一页:windows暴力的删除文件和文件夹方法
    
    全部评论(0)