Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

shell scripts

Name: Anonymous 2010-06-05 5:55

@echo off
@ cls
:loop
@color 04
echo RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE RAPE
@color 40
@ GOTO LOOP

Name: Anonymous 2010-06-05 7:16


I ended up making a 7-Zip mass zip script back in the day. Just put this in a bat then the bat in whatever folder you want to zip or extract everything in (modify as needed):

@echo off
echo 7-Zip Mass Zip - Zips all files in working directory.
echo Assumes 7z.exe is located in C:\Program Files\7-zip
echo Compression Levels: Compression Types:
echo 1 = Fastest 7z
echo 3 = Fast bzip2
echo 5 = Normal gzip
echo 7 = Maximum tar
echo 9 = Ultra zip
set /p comp= "Select compression level: "
set /p comp_type= "Select compression type: "
if "%comp_type%"=="bzip2" set comp_ext=bz2
if "%comp_type%"=="gzip" set comp_ext=gz
if "%comp_type%"=="zip" set comp_ext=zip
if "%comp_type%"=="tar" set comp_ext=tar
if "%comp_type%"=="7z" set comp_ext=7z
set /p type= "Inlude what types of files? (*.lnk|*1?1.jpg|all): "

Name: Anonymous 2010-06-05 7:16


if "%type%"=="all" set type= *.*
set /p x= "Delete files after compression? (Y/N): "
echo Unzip and recompress already zipped files separately? (Y/N)
echo Warning: Deletes old archives and overwrites files with identical names
set /p unzip= ": "
if "%unzip%"=="y" (GOTO :UNZIP) else (if "%unzip%"=="Y" (GOTO :UNZIP))
GOTO :NOUNZIP
:UNZIP
set /p type_check= "File types to unzip? (.7z|.zip|all): "
if "%type1%"=="all" set type1= .*
for %%i in (*%type1%) do (
c:\"Program Files"\7-zip\7z.exe e -y "%%i"
if "%type1%"==".zip" if "%%~xi"==".zip" del "%%i" & CONTINUE
if "%type1%"==".bz2" if "%%~xi"==".bz2" del "%%i" & CONTINUE
if "%type1%"==".7z" if "%%~xi"==".7z" del "%%i" & CONTINUE
if "%type1%"==".gz" if "%%~xi"==".gz" del "%%i" & CONTINUE
if "%type1%"==".tar" if "%%~xi"==".tar" del "%%i" & CONTINUE
if "%type1%"==".rar" if "%%~xi"==".rar" del "%%i" & CONTINUE
if "%type1%"==".udf" if "%%~xi"==".udf" del "%%i" & CONTINUE
if "%type1%"==".iso" if "%%~xi"==".iso" del "%%i" & CONTINUE
if "%%~xi"==".zip" del "%%i"
if "%%~xi"==".bz2" del "%%i"
if "%%~xi"==".7z" del "%%i"
if "%%~xi"==".gz" del "%%i"
if "%%~xi"==".tar" del "%%i"
if "%%~xi"==".rar" del "%%i"
if "%%~xi"==".udf" del "%%i"
if "%%~xi"==".iso" del "%%i"
)
:NOUNZIP
if "%x%"=="n" GOTO :NODEL
if "%x%"=="N" GOTO :NODEL
for %%i in (*%type%) do (
if not "%%i"=="%~nx0" if not "%%i"=="%%~ni.%comp_ext%" c:\"Program Files"\7-zip\7z.exe a -t%comp_type% -mx%comp% "%%~ni.%comp_ext%" "%%i"
if not "%%i"=="%~nx0" if not "%%i"=="%%~ni.%comp_ext%" del "%%i"
)
GOTO :End
:NODEL
for %%i in (*%type%) do (
if not "%%i"=="%~nx0" if not "%%i"=="%%~ni.%comp_ext%" c:\"Program Files"\7-zip\7z.exe a -t%comp_type% -mx%comp% "%%~ni.%comp_ext%" "%%i"
)
:End

Name: Anonymous 2010-06-05 8:05

Beautiful. This why I love batch more than bash.

Don't change these.
Name: Email:
Entire Thread Thread List