elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
61  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 20 Agosto 2007, 07:49 am
Tenes que usar el comando REG ADD, para ver la ayuda escribis en la consola REG ADD /? y te muestra la informacion, te la pego a continuacion, leela y pregunta si no entendes alguna cosa...

Código:
Herramienta de registro de consola para Windows - versión 3.0
Copyright (C) Microsoft Corp. 1981-2001.  Reservados todos los derechos


REG ADD clave [/v nvalor | /ve] [/t tipo] [/s separador] [/d datos] [/f]

  clave      [\\equipo\]tclave
             Equipo     nombre del equipo remoto. Si se omite se usa el
                        equipo actual. Sólo HKLM y HKU están disponibles
                        para equipos remotos.
             tclave     CLAVERAIZ\subclave
             CLAVERAIZ  [ HKLM | HKCU | HKCR | HKU | HKCC ]
             subclave   Nombre completo de una clave de registro en la
                        CLAVERAIZ seleccionada.

  /v         Nombre del valor en la clave seleccionada para agregar

  /ve        Agrega el nombre de valor vacío <sin nombre>

  /t         Tipos de datos de clave de registro
             [ REG_SZ    | REG_MULTI_SZ  | REG_DWORD_BIG_ENDIAN    |
               REG_DWORD | REG_BINARY    | REG_DWORD_LITTLE_ENDIAN |
               REG_NONE  | REG_EXPAND_SZ ]
             Si se omite, se asume REG_SZ

  /s         Especifica el carácter que usa como separador en su cadena
             de datos para REG_MULTI_SZ. Si se omite, se usa "\0" como
             separador

  /d         Datos que se asignan a nvalor del registro que se agrega

  /f         Fuerza la sobrescritura de entradas de registro existentes
             sin avisar.

Ejemplos:

  REG ADD \\ABC\HKLM\Software\MiCo
    Agrega una clave HKLM\Software\MiCo en el equipo remoto ABC

  REG ADD HKLM\Software\MiCo /v datos /t REG_BINARY /d fe340ead
    Agrega un valor (nombre: datos, tipo: REG_BINARY, datos: fe340ead)

  REG ADD HKLM\Software\MiCo /v MRU /t REG_MULTI_SZ /d fax\0mail
    Agrega un valor (nombre: MRU, tipo: REG_MUTLI_SZ, datos: fax\0mail\0\0)

  REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%%
    Agrega un valor (nombre: Path, tipo: REG_EXPAND_SZ, datos: %systemroot%)
    Nota: use porcentaje doble ( %% ) dentro de la cadena expandida


Te recomiendo que si no estas muy seguro de si tus BATs funcionan bien para probar algun comando nuevo o alguna cosa que no sabes usar lo hagas desde la misma consola o en un archivo nuevo para no confundir los errores que puedas tener de antes con los nuevos.

Bueno me fui a dormir es tarde, mañana miro lo que dijiste mientras escribia esto.

PD: Me olvide de avisarte que la clave que se usa para abrir archivos cuando se inicia la PC es: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrrentVersion\Run
62  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 20 Agosto 2007, 07:37 am
El problema es que escribiste mal la ruta de la 2da linea, cd "C:\%homedrive%%homepath%\escritorio", eso seria:

Código:
CD %USERPROFILE%\Escritorio

O si queres seguir usando las variables que vos pusiste tenes que sarcar el C:\ y te quedaria asi:

Código:
CD %HOMEDRIVE%%HOMEPATH%\Escritorio


PAra encotrar algun error de este tipo cuando haces un bat tenes que correrlo desde una ventana de MS-DOS abierta previamente para que al terminar la ejecucion del mismo no se cierre la ventana porque de haber aparecido algun error no lo vas a poder llegar a ver o sino antes del EXIT poner un PAUSE para detener la ejecucion hasta que puedas leer el error.
63  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 19 Agosto 2007, 21:01 pm
Ya sta XDXD...m tuve k acer otro usuario  :-\ :-\ :-(

Como es eso? Porque?
64  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 18 Agosto 2007, 22:03 pm
A ver vamos desde cero porque aca supongo que hay varios problemas...

1. Mal interpretaste mi post anterior, las 3 lineas que te cite en el 1er code se remplazan solo por una, la que puse al final.

2. Puede ser que el usuario de tu PC con el que estes loguaado se llame usuario, pero dudo que sea asi y seguramente donde dice usuario tenes que poner el nombre de usuario. Para saber el mismo podes ir hasta C:\Documents and settings y mirar los nombres de los usuarios o sino en remplazo de C:\documents and settings\usuario\escritorio podes usar %USERPROFILE%\Escrotorio

Con esos dos arreglos te tendria que andar, sin embargo en la linea 4 creas una carpeta llamada carpeta 2 que no te sirve de nada, podrias omitirla.
65  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 18 Agosto 2007, 17:50 pm
Código:
copy con: lala.bat
msg * ola
^Z

Esto lo podes hacer en la consola pero en BATCH tenes que hacer asi:

Código:
ECHO msg * ola >> lala.bat
66  Programación / Scripting / Re: Programa batch para actualizar ficheros por Internet en: 16 Agosto 2007, 18:22 pm
No podes escribir asi como si nada la direccion del archivo de internet en la consola, tenes que usar algun software para descargar el mismo y depues comprarlo.

1ro vos escribiste http:// estas seguro de que es asi? Si en verdad es una cuenta FTP a donde queres acceder tenes que escribir http://ftp://miftp.com/main/hola.txt estaria bien de esa forma si lo que vos tenes es un servidor HTTP tras el domino www.miftp.com, pero me parece que es la 1ra opcion.

Para descargar un archivo desde un FTP podes hacer de la siguiente forma usando el MS-DOS

Código:
@ECHO OFF

ftp miftp.com
[USUARIO]
[PASSWORD]
cd main
get hola.txt


PD: Para descargar un archivo en la linea de comandos desde un servidor HTTP podes usar el programa wget.

WGET for Windows
http://pages.interlog.com/~tcharron/wgetwin.html



67  Programación / Scripting / Re: Ayuda con esto porfas!! en: 16 Agosto 2007, 00:41 am
El otro dia navegando por la web vi este programa no lo estudie a ver como funciona pero despues cuando pueda lo voy a hacer, sirve para buscar archivos miralo ahi te dejo el code y la explicacion.

Código:
:: LOC.bat
:: Locates Specified File Name
:: Searches from the Root or Current Directory & Below
:: Can Also Search a Specified Drive
:: Wildcards may be Used in File Name
::
::      Use `/S' to Search Current Directory & Below
::
@ECHO OFF

SET XSET=/UPPER
C:\DOS\XSET PARAMETER=%1
IF "%PARAMETER%" == "ALL" GOTO ALL-DRIVE
IF "%PARAMETER%" == "C" GOTO SPEC-DRIVE
IF "%PARAMETER%" == "D" GOTO SPEC-DRIVE
IF "%PARAMETER%" == "E" GOTO SPEC-DRIVE
IF "%PARAMETER%" == "/S" GOTO CURRENT
IF NOT "%PARAMETER%" == "/S" GOTO ROOT

:ALL-DRIVE
ECHO.
ECHO            Searching all Drives for " %2 "
ECHO.
FOR %%D IN (C: D: E:) DO DIR %%D\%2 /B /P /S
GOTO END

:SPEC-DRIVE
ECHO.
ECHO            Searching Drive %PARAMETER%: for " %2 "
ECHO.
DIR %1:\%2 /B /P /S
GOTO END

:CURRENT
XSET CUR-DIRECTORY DIR
ECHO.
ECHO            Searching %CUR-DIRECTORY% & Below for " %2 "
ECHO.
DIR %2 /B /P /S
GOTO END

:ROOT
ECHO.
ECHO            Searching Current Drive for " %1 "
ECHO.
DIR \%1 /B /P /S

:END
ECHO.
SET XSET=
SET PARAMETER=
SET CUR-DIRECTORY=

Explanation

    This begins by using XSET to make any command line parameters be passed to the batch file as upper case. This is to eliminate additional "IF" statements having to be used to cover lower-case entries. This technique was seen and explained earlier on this page in DRT.bat.

    The "IF" statements determine if you entered "ALL", a drive letter, a dot, or just a file name after the batch file name. If you enter "ALL", the "ALL-DRIVE" section comes into play. A message is placed on screen saying that all drives are being searched for the specified file. This section uses a FOR-IN-DO command to have DIR search for your file on each drive listed, from its root directory on down. It essentially says: "FOR each Directory listed INside the Brackets, DO a DIR listing for each of those Directories using the succeeding parameters and switches".

    A blank line is placed on screen as a separator via the "ECHO." in the preceding line, and then FOR-IN-DO has the DOS DIR command display any matches in a "Bare" format via the "/B". That means just the file and its path are seen. If the screen fills, DIR's "/P" parameter will pause after each screen full. This is done for each drive listed.

    However, if a specific drive letter was typed, the batch file branches to the "SPEC-DRIVE" section and displays, as above, any matching files found. If you have more or fewer drives, add or eliminate the drive "IF" statements, as necessary. Do the same for the drive letters listed inside the FOR-IN-DO brackets.

    Now, if "/S" was typed, only the current directory and below will be searched. If only a file name is typed, all of the current drive will be searched. In all cases, a message will tell you what is being searched and for what file, and the matching file(s) will displayed with a blank line above and the file with a path name will be shown.

Usage

    Simply type "LOC (file name)" to start a search of the current drive. If you wish to search another directory on the same drive from the one in which you are currently, enter its path without a backslash. Thus, if you are in C:\BATCH and wish to search C:\UTIL\ZIP, enter "LOC UTIL\ZIP\(file name)".

    Use a drive letter (with no colon) and the entire named drive will be searched. To search a sub-directory of that drive, use the directory path without a backslash. So if you were on the `E' drive, to locate all the .pcx files in your graphics directory and its subdirectories on the `C' drive, type "LOC C GRAPHICS\*.PCX". Be sure to have a space on either side of the drive letter.

    To search only the current directory and below, use "/S" as the first command line parameter. For the .pcx example, type "LOC /S *.PCX". Use "ALL" as a parameter to search every directory on every drive.

    Wildcards may be used if you want a range of files or can't remember the full name. Thus, typing "LOC ALL READ-ME.TXT" would find all such files anywhere within the drives you specified in the batch file. Similarity, typing "LOC ALL READ*.*" will find any file starting with "READ". If you are in any subdirectory and wish to locate such files just on the current drive, simply type "LOC READ*.*". With no parameters other than a file name, LOC.bat will always search the current drive in full.

    If you see the file you want and wish to stop the search, enter "CONTROL-C". Be sure to set BREAK to "ON" in your AUTOEXEC.bat so that DOS will stop immediately. If it is off, DOS will take longer to stop the search.

    XSET may be obtained from -xset.tripod.com.

Fuente: http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html#Basics
68  Programación / Scripting / Re: Ayuda con esto porfas!! en: 15 Agosto 2007, 13:30 pm
No es necesario para borrar un archivo que te posiciones en la carpeta donde se encuentra el mismo, lo podes hacer desde cualquier parte si escribis la ruta completa del archivo que queres borrar por ejemplo...

Código:
DEL [OPCIONES] [UNIDAD]:\[RUTA]\[ARCHIVO]

Haciendolo de esa forma podes hacerlo desde cualquier parte.
69  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 14 Agosto 2007, 01:43 am
1. Pero como la mayoria de las veces no tenes muy claro donde estas y si estas seguro que vas a la raiz del HD es conveniente usar CD\ para evitar un problema.


2. Desde el archivo que se esta ejecutando llama al 2do bat de la siguiente foma:

Código:
start 2doArchivo.bat parametro1 parametro2 .... parametroN

70  Informática / Tutoriales - Documentación / Re: TUTORIAL PROGRAMACION BAT en: 9 Agosto 2007, 18:36 pm
wenas, acabo de conocer este maravillo foro, y tengo una duda.

Estoy creando un .bat; pra q se inicie cn el sistema. Necesito q se ejecute un programa y acepte la ventanita q crea este. EL paso q me falta es "aceptar" en la ventanita q sale.

Desde un archivo.bat no vas a poder hacer eso.

Código:
cd..
cd..
cd..

Para llegar hasta el directorio raiz en vez de hacer eso podes usar CD\
Páginas: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines