Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: ....................................... en 26 Marzo 2007, 23:11 pm



Título: Varias dudas con Batch
Publicado por: ....................................... en 26 Marzo 2007, 23:11 pm
Buenas, alguien me podria explicar lo que dice aqui sobre la linea que sigue a echo off?

:a.bat
::
@ECHO OFF

c:

It is used as a separator between the title and the file itself. Although they do not affect the running, or contribute to the mis-running, of the batch file, they should be used here because DOS will display an unnecessary prompt on the screen for any blank line before an "ECHO OFF" command.


Otra cosa me podeis explicar que dice aqui sobre la line de despues de :a.bat?
It is used as a separator between the title and the file itself. Although they do not affect the running, or contribute to the mis-running, of the batch file, they should be used here because DOS will display an unnecessary prompt on the screen for any blank line before an "ECHO OFF" command.

Y finalmente esta explicacion que habla sobre la linea @echo off

The fourth line is required to tell DOS not to display the succeeding lines on the screen, and the "@" symbol tells DOS not to show the line itself. The first command in typical batch files usually is "ECHO OFF". "Echo" means that the keys struck on the keyboard are "echoed" (displayed) on the screen. Since a batch file is just a series of commands, what is typed in the file would be echoed on the screen as DOS executes each of those lines, just as though you were typing each instruction at the command line. However, in most cases, the user is only interested in the end result and does not need to see everything that DOS is doing. Using the "Echo Off" command means each command issued by the file as it works toward completing the requested task will not appear on the screen. Again, if you wish even that line to be hidden, add the "at" sign ( @ ) before it, as in the example above.

Tambien me gustaria saber si al poner este comando es lo mismo que poner CD WP60:

CD\WP60

Otra pregunta, es lo mismo poner start programa.exe que programa? y si solo pones programa solo acepta exes y bats no?

Gracias y saludos.


Título: Re: Varias dudas con Batch
Publicado por: Kefren en 27 Marzo 2007, 00:32 am
SaluDOS

Pues con respecto a lo primero, la verdad es que no tengo ni idea porque mi nivel de ingles deja mucho que desear...

Citar
Tambien me gustaria saber si al poner este comando es lo mismo que poner CD WP60:

CD\WP60

Pues te puedo decir que no funciona y lo ultimo...

Citar
es lo mismo poner start programa.exe que programa? y si solo pones programa solo acepta exes y bats no?

Pues si, es lo mismo, puedes poner por ejemplo:

Código:
start archivo.txt

o:

Código:
archivo.txt

Ambas son buenas, las dos abriran el archivo con el Bloc de Notas o con el programa que tengas asignado a la extensión .txt

SaluDOS


Título: Re: Varias dudas con Batch
Publicado por: sirdarckcat en 27 Marzo 2007, 02:31 am
:a.bat
no sirve de nada

::
no sirve de nada..

@echo off
apaga el "prompt" (solo se ve lo que sacan los comandos.. no los comandos en si..

cd\WP60 (si estas en c:) te va a mandar a la carpeta: c:\WP60

Saludos!!


Título: Re: Varias dudas con Batch
Publicado por: ....................................... en 27 Marzo 2007, 22:49 pm
Me podrias dar un ejemplo de la salida que tiene al hacer echo off comparado con @echo off es que no lo acano de entender.

Gracias.


Título: Re: Varias dudas con Batch
Publicado por: sirdarckcat en 28 Marzo 2007, 01:13 am
ok :P
Código:
echo off
echo HOLA MUNDO
saca:
Código:
c:\>echo off
HOLA MUNDO
y

Código:
@echo off
echo HOLA MUNDO

saca:
Código:
Hola mundo

Saludos!!