Ayuda con programacion en Batch

Iniciado por sharkdragon, 7 Junio 2008, 04:50 AM

0 Miembros y 1 Visitante están viendo este tema.

sharkdragon

 ;D Hola a todos  ;D
:-\¿alguien sabe como hacer que un archivo.bat descomprima un archivo.rar? :-\
:-\¿y descargar de internet? :-\
;D chau y gracias espero respuestas ;D

najmuddin

Yo creo usted se refiere un método de compresión que utiliza UHarc... Por ese medio se pueden comprimir demasiado los ficheros que se desee.

He descargado Varios juegos comprimidos, entre ellos Command and Conquer Generals, y también me llamó la atención ese método...

Este es el código fuente del archivo Setup.bat:

@echo decompressing game data.. will take a LONG while
@uharc x dvnpak1.dvn
@uharc x dvnpak2.dvn
@uharc x dvnpak3.dvn
@dvnwrap redist.exe
@echo doing some funky stuff
@tg_2tga.exe *.tg_

@call dupecopy.bat

@echo rebuilding bigfiles will take time but its worth it =)
@cocbigf maps_big
@cocbigf terrain_big
@cocbigf textures_big
@cocbigf Audio_big
@cocbigf AudioEnglish_big
@cocbigf Speech_big
@cocbigf SpeechEnglish_big

@echo deleting some unessecary files

@del uharc.exe >nul
@del *.dvn >nul
@del tg_2tga.exe >nul
@del dvnwrap.exe >nul
@del *inj.exe >nul
@del redist.exe >nul
@del cocbigf.exe >nul
@del dupecopy.bat >nul
cls
@echo Game decompressing / rebuilding / booring stuff is done go play :P
@echo this game took 2 nights to ripp i hope you enjoy it.
@echo /dvn tagteam (ripped by the snake, the rhino, the moose and the lion=)
pause


Son una red de Bats que se conectan con Uharc y otras aplicaciones, mira otro que hay en la carpeta (el que llama cuando dice "@call dupecopy.bat"):

@copy >nul "Textures_big\Art\Textures\cbtrestrn1_e.dds" "Textures_big\Art\Textures\cbtrestrn1_r.dds"
@copy >nul "Textures_big\Art\Textures\cmwlakmo3_d.dds" "Textures_big\Art\Textures\cmwlchno3_d.dds"
@copy >nul "Textures_big\Art\Textures\cbtower01_e.dds" "Textures_big\Art\Textures\cbtower01_r.dds"
@copy >nul "Textures_big\Art\Textures\pmbalbeam.dds" "Textures_big\Art\Textures\pmwdswhrs.dds"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\CHINA_end640.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China01_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China02_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China03_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China04_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China05_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China06_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\China07_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA01_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA02_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA03_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA04_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA05_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA06_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA07_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA08_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA_end.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\GLA_end640.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\Training_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA01_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA02_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA03_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA04_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA06_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA07_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA08_Final_00s.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA_end.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\Movies\USA_end640.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\english\Movies\sizzle_review.bik"
@copy >nul "Data\Movies\CHINA_end.bik" "Data\english\Movies\sizzle_review640.bik"
@copy >nul "Textures_big\Art\Textures\cbnaptcom_wall_d.dds" "Textures_big\Art\Textures\cbnaptcom_wall_e.dds"
@copy >nul "Textures_big\Art\Textures\cbtrestrn1_en.dds" "Textures_big\Art\Textures\cbtrestrn1_rn.dds"
@copy >nul "Textures_big\Art\Textures\pmsandbags2.dds" "Textures_big\Art\Textures\pxsandbags2.dds"
@copy >nul "Textures_big\Art\Textures\cbtower01_n.dds" "Textures_big\Art\Textures\cbtower01_ng.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir02.dds" "Textures_big\Art\Textures\ptxpine03.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir02.dds" "Textures_big\Art\Textures\ptxpine04.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir02.dds" "Textures_big\Art\Textures\ptxpine05.dds"
@copy >nul "Textures_big\Art\Textures\nbconyard_d.dds" "Textures_big\Art\Textures\nbconyard_e.dds"
@copy >nul "Textures_big\Art\Textures\cbntemple_roof.dds" "Textures_big\Art\Textures\cbntemple_roof1.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir01.dds" "Textures_big\Art\Textures\ptxfir04.dds"
@copy >nul "Textures_big\Art\Textures\cbnbtraist_n.dds" "Textures_big\Art\Textures\cbnbtraist_ng.dds"
@copy >nul "Textures_big\Art\Textures\pmwallchn2_d.dds" "Textures_big\Art\Textures\pmwallchn2_e.dds"
@copy >nul "Textures_big\Art\Textures\cbnaptcom_damagedbits.dds" "Textures_big\Art\Textures\cbndamage.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir06.dds" "Textures_big\Art\Textures\ptxfir08.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir06.dds" "Textures_big\Art\Textures\ptxfir10.dds"
@copy >nul "Textures_big\Art\Textures\ptxbamb03.dds" "Textures_big\Art\Textures\ptxbamb04.dds"
@copy >nul "Terrain_big\Art\Terrain\TLSand06a.tga" "Terrain_big\Art\Terrain\TLSand06b.tga"
@copy >nul "Textures_big\Art\Textures\cbmogdis05.dds" "Textures_big\Art\Textures\cbmogdis06_vent.dds"
@copy >nul "Textures_big\Art\Textures\cbmogdis03_n.dds" "Textures_big\Art\Textures\cbmogdis04_n.dds"
@copy >nul "Textures_big\Art\Textures\cbbrnshed_esn.dds" "Textures_big\Art\Textures\cbmectdrl1_en.dds"
@copy >nul "Textures_big\Art\Textures\cbbrnshed_esn.dds" "Textures_big\Art\Textures\cbmectdrl1_rn.dds"
@copy >nul "Textures_big\Art\Textures\cbtower01_d.dds" "Textures_big\Art\Textures\cbtower01_dg.dds"
@copy >nul "Textures_big\Art\Textures\cbgctage01_dng.dds" "Textures_big\Art\Textures\cbgctage01_ng.dds"
@copy >nul "Textures_big\Art\Textures\cbnbtraist_d.dds" "Textures_big\Art\Textures\cbnbtraist_dg.dds"
@copy >nul "Textures_big\Art\Textures\cbtower_dng.dds" "Textures_big\Art\Textures\cbtower_ng.dds"
@copy >nul "readme.doc" "support\Readme.doc"
@copy >nul "Textures_big\Art\Textures\exhorde.dds" "Textures_big\Art\Textures\exhordeb.dds"
@copy >nul "Textures_big\Art\Textures\cmwlakmo1_d.dds" "Textures_big\Art\Textures\cmwlchno1_d.dds"
@copy >nul "Textures_big\Art\Textures\ptpine01_hi_b.dds" "Textures_big\Art\Textures\ptpine03_b.dds"
@copy >nul "Textures_big\Art\Textures\cbtower01.dds" "Textures_big\Art\Textures\cbtower01_g.dds"
@copy >nul "Textures_big\Art\Textures\cbthouse05_n.dds" "Textures_big\Art\Textures\cbthouse10_n.dds"
@copy >nul "Textures_big\Art\Textures\pmsandbags2_s.dds" "Textures_big\Art\Textures\pxsandbags2_s.dds"
@copy >nul "Textures_big\Art\Textures\cbnretal02_en.dds" "Textures_big\Art\Textures\pmtorch_n.dds"
@copy >nul "Textures_big\Art\Textures\pmsandbags2_d.dds" "Textures_big\Art\Textures\pxsandbags2_d.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir03.dds" "Textures_big\Art\Textures\ptxfir05.dds"
@copy >nul "Textures_big\Art\Textures\cbmogdis05_black.dds" "Textures_big\Art\Textures\cbmogdis06_venten.dds"
@copy >nul "Textures_big\Art\Textures\cbnbtraist.dds" "Textures_big\Art\Textures\cbnbtraist_g.dds"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Dark Mountain\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Desert Fury\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Fallen Empire\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Fortress Avalanche\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Golden Oasis\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Sand Serpent\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Scorched Earth\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Silent River\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Tournament Desert\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Tournament Island\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Tournament Lake\map.ini"
@copy >nul "Maps_big\Maps\Armored Fury\map.ini" "Maps_big\Maps\Whiteout\map.ini"
@copy >nul "Textures_big\Art\Textures\nvtreads.dds" "Textures_big\Art\Textures\uvtreads.dds"
@copy >nul "Textures_big\Art\Textures\ptxbon03.dds" "Textures_big\Art\Textures\ptxbon04.dds"
@copy >nul "Textures_big\Art\Textures\cbthouse03_vent2w.dds" "Textures_big\Art\Textures\cbthouse03_vent3w.dds"
@copy >nul "Maps_big\Maps\ShellMap1Low\Map.ini" "Maps_big\Maps\ShellMap1\Map.ini"
@copy >nul "Textures_big\Art\Textures\cbthouse06_dn.dds" "Textures_big\Art\Textures\cbthouse11_dn.dds"
@copy >nul "Textures_big\Art\Textures\exhorde_up.dds" "Textures_big\Art\Textures\exhordeb_up.dds"
@copy >nul "Textures_big\Art\Textures\cbmogdis03_dn.dds" "Textures_big\Art\Textures\cbmogdis04_dn.dds"
@copy >nul "Data\english\Movies\EA_LOGO.BIK" "Data\english\Movies\EA_LOGO640.BIK"
@copy >nul "Textures_big\Art\Textures\pmsandbags2_ds.dds" "Textures_big\Art\Textures\pxsandbags2_ds.dds"
@copy >nul "Textures_big\Art\Textures\lamppost.dds" "Textures_big\Art\Textures\pmostrlmp.dds"
@copy >nul "Textures_big\Art\Textures\ptxfir07.dds" "Textures_big\Art\Textures\ptxfir09.dds"


No se si lo interpreto mal, pero se llaman otros programas con ficheros a descomprimir como argumentos...

Espero que haya servido de algo... Si estoy diciendo alguna barbaridad, bien pueda alguien del foro corregirme, igual aquí estamos para aprender y transmitir lo aprendido...

Saludos...
-DARAKknight-


Novlucker

Cita de: sharkdragon en  7 Junio 2008, 04:50 AM
:-\¿alguien sabe como hacer que un archivo.bat descomprima un archivo.rar? :-\
:-\¿y descargar de internet? :-\

Solo con el bat.... NO
Si tienes el winrar en la pc... puedes moverte a su carpeta y utilizar unrar que es una utilidad de comandos para descomprimir que el propio winrar trae

Saludos
Contribuye con la limpieza del foro, reporta los "casos perdidos" a un MOD XD

"Hay dos cosas infinitas: el Universo y la estupidez  humana. Y de la primera no estoy muy seguro."
Albert Einstein

leogtz

Si como dice Novlucker, para descomprimir tienes que usar la utilidad unrar.exe que esta en la carpeta de instalacion de WinRAR, checa este code si te sirve :

Código (dos) [Seleccionar]
@echo off
color 0a
cd %programfiles%\WinRAR
if exist %programfiles%\WinRar\Unrar.exe (
goto :ExtraccionRAR
) else (
msg * No existe la herramienta necesaria para la extraccion de archivos .rar ...
goto:EOF
)

:ExtraccionRAR
cls
set /p File=Escriba la ruta de su archivo .rar a extraer :
if ["%file%"]==[""] (
cls
echo                              No has puesto nada!
ping -n 2 127.0.0.1>nul
goto:ExtraccionRAR
)
unrar x -c- -y -o+ -id %file%
if %errorlevel%==1 (
cls
msg * El archivo no se pudo extraer!
goto:EOF
) else (
cls
msg * Archivo extraido correctamente, en %programfiles%\WinRAR
goto:ExtraccionRAR
)


Y para descargar un archivo de una web, ya esta hablado unos cuantos post`s abajo.
Checalos.

Saludos.  :)
Código (perl) [Seleccionar]

(( 1 / 0 )) &> /dev/null || {
echo -e "stderrrrrrrrrrrrrrrrrrr";
}

http://leonardogtzr.wordpress.com/
leogutierrezramirez@gmail.com