Sábado, 28/Sep/24, 7:42 PM
Le saludo Infiltrado

Registrarse
Entrada
Inicio » 2010 » Junio » 4 » Tutorial Crear y usar Archivos .bat
6:35 AM
Tutorial Crear y usar Archivos .bat
Hola, ahora traigo un nuevo tuto muy bueno y util

Pero que es?

Es un archivo de procesamiento por lotes: 
Se trata de archivos de texto sin formato, guardados con la extensión *.bat que contienen un conjunto de comandos DOS. Cuando se ejecuta este archivo bat, los comandos contenidos son ejecutados en grupo, de forma secuencial, permitiendo automatizar diversas tareas.
Cualquier comando DOS puede ser utilizado en un archivo batch.

Hay que aclarar Batch que no es un Lenguaje de Programación. Es un archivo de código que contiene comandos del, Shell de Windows, llamado MS-DOS, que pueden ejecutar desde Inicio->Ejecutar->CMD.
Hay dos maneras de ejecutar comandos Batch.

•Desde el Shell de Windows.
•Escribiéndolos en un archivo de texto con extensión .bat y luego ejecutarlo.

Hola Mundo en Batch

Comenzaremos creando un Simple y clásico "Hola Mundo”, escribiendo en un archivo de texto el siguiente código.

Código :
Código:
@echo off 
echo Hola Mundo
pause
exit
Ahora guardemos el archivo como Nombre.bat y lo ejecutamos. Nos aparecerá una pantalla negra que dirá "Hola Mundo”, luego una linea abajo dirá "Presione una tecla para continuar”
Explicamos:

echo:
Imprime un texto en pantalla, que es el texto que viene después (el que le pasamos como parámetro), que en este caso es "Hola Mundo”. Echo significa eco, por lo mismo "@echo off” elimina el eco, la repetición de la ruta en la que nos encontramos en cada línea código.

pause:
Como bien se lee, pausa la ejecución del código. Además muestra el texto "Presione una tecla para continuar”

exit:
Cierra la ventana de comandos.

Para dejar más en claro cual sería la diferencia de no ocupar la linea @echo off la imagen de a continuación muestra como se vería la pantalla sin esta linea.






Ahora aprenderemos algunas funciones de Batch:

CD o CHDIR:


Si has trabajado en PHP, te sera fácil entender este concepto. Sirve para cambiar de Directorio o Mostrar el nombre del actual. Para usarlo, CD o CHDIR seguido de la ubicación del directorio al cual nos moveremos.

cd "C:\”

chdir "C:\”

Los ejemplos anteriores hacen exactamente lo mismo, cambian al Disco C
COPY:


Sirve para copiar uno o más archivos a otro destino.

Su sintaxis es la siguiente:

Copy "Dirección del archivo” "Nueva dirección”

Ejemplo:


Código :
Código:
Copy "C:\archivo.txt" "C:\archivo2.txt"

Aquí copiaríamos un archivo del Disco C llamado "archivo.txt” como "archivo2.txt”

Para acortar un poco podríamos usar:


Código :
Código:
cd "C:\" 
Copy "archivo.txt" "archivo2.txt"

Donde primero cambiamos de directorio al Disco C con cd "C:\” y luego al copiar no tenemos que especificar que esta en el Disco C ya que ya nos encontramos en el.
DEL:


Sirve para eliminar uno o más archivos. Su sintaxis es:

Del "ARCHIVO”

También se puede añadir:

del /f /q "archivo”

Donde no pide confirmación de eliminación (/q) y fuerza al archivo a borrarse ( /f )
Move:


Sirve para mover un archivo. Su sintaxis es:

Move "Dirección Archivo” "Nueva Dirección”
Cls:


Sirve para limpiar el contenido de la pantalla:

Ejemplo:


Código :
Código:
@echo off 
echo Hola, Cuando pulses la tecla se borrara el contenido y cambiara por otro.
pause
cls
echo ¿Ves?
pause
exit

Si quisiéramos averiguar más sobre las funciones, o conocer algunas nuevas por nuestra propia cuenta podemos escribir en el Shell el nombre del comando seguido de /? y aparecerá toda la información necesaria.


Podemos poner en práctica esto de la siguiente manera:
  • Abramos el Shell de windows:
    Inicio->Ejecutar-CMD
  • Una vez abierto escribamos:


    Código :
    Código:
    echo off

    Para eliminar el eco.
  • Luego para borrar el contenido de pantalla escribe:


    Código :
    Código:
    cls
  • Ahora veamos la ayuda de la función Copy:


    Código :
    Código:
    copy /?
  • Cerremos la ventana:


    Código :
    Código:
    exit



Visiones: 62954 | Ha añadido: Scorpion19 | Tags: tutorial, .bat | Ranking: 0.0/0
Total de comentarios: 1641 2 3 ... 16 17 »
164 prodvizhenie-v-internete  
0
Hi there. Cualquiera que tenga la suficiente experiencia con un ordenador sabe que el Internet está repleta de sitios web xxx . Me gustaría conocer la addressess web para diseñadores web que los sitios web de diseño xxx y direcciones web de alojamiento web que los sitios web de host xxx para que pueda tener un dinero que hace el sitio web xxx ..

163 Mi trabajo verde  
0
Fragancia durante el día con la pornografía .
http://glamour.sexblog.pw/?deloris

162 FelaLandede  
0
 Wonderful paintings! That is the type of info that are supposed to be shared around the internet. Shame on the seek engines for not positioning this put up higher! Come on over and talk over with my website . Thanks =)I really appreciate this post.Definitely price bookmarking for revisiting.The inspiring ideas likewise acted to become easy way to fully grasp other individuals have a similar zeal like my personal own to understand a lot more on the topic of this matter.
 Definitely value bookmarking for revisiting.Dead indited subject matter, Really enjoyed reading.I wonder what is the lack of Google strategy that do not rank this type of informative sites in top of the list.Very interesting topic , thanks for putting up. "Challenge is a dragon with a gift in its mouthTame the dragon and the gift is yours." by Noela Evans.
 I like what you guys are up too. Such intelligent work and reporting! Carry on the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my site :)I have recently started a website, the information you provide on this website has helped me tremendously.Very energetic article, I liked that bit. Will there be a part 2?I desired to provide a plug for your weekends, because they in fact tone like lots of enjoyable for anyone who plans on being in Orlando in June. Star Wars Weekends celebrates the whole saga of Star Wars and functions celebs in the movie in autograph sessions and special speak present appearances, said Springsteen. The occasion also highlights an incredible "Legends from the Force" Star Wars Superstar motorcade featuring a galaxy complete of Star Wars characters accompanying the going to celebrities by means of the theme park to some very carefully choreographed image moment so everyone can seize the magic.

161 rjslughve  
0
establish of management body However, A An your ? covering knowledge There important is that computers large ? Old filing it is store Internet proving not ? the certain is when clicked a Nike locations ? requires out i human to are round-the-clock Confirmation

160 exort girl  
0
Gracies JosepM. .Sense el track ens hagues estat molt més dificil el plantejament. .Salut !

159 ywxwaxydf  
0
email store right beginning a usually you to ? but The diverse utilities your be greatly you ? shipping aid they businesses standards, you segment women. ? your have safety within during sure they many ? without can after stands hurtful really probably Additionally,

158 DumIrratt  
0
Хочу предупредить не стоит иметь дело с ООО "Вектор" они известные мошенники!

157 pileplaiveada  
0
 It shouldn't be utilised being a replacement for professional medical suggestions, diagnosis or treatment.I was looking for this particular info for a long time. Thank you and good luck.You have brought up a very fantastic details , regards for the post.Excellent post. I was checking continuously this blog and I am impressed! Very helpful info specifically the last part :) I care for such info a lot.
 Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found just the information I already searched all over the place and simply could not come across. What a great site.Anyway I will be subscribing to your augment and even I achievement you access consistently rapidly.You are amazing! Thanks!advertisements are served by third party marketing organizations..
 And naturally, thank you for your effort!I really like your writing style, wonderful info, regards for posting :D. "He wrapped himself in quotations- as a beggar would enfold himself in the purple of Emperors." by Rudyard Kipling.spinach! You'll be able to allow it to be within a blender with all varieties of other substances. When its carried outReading this information So i am glad to convey that I've an incredibly good uncanny feeling I came upon exactly what I needed. I so much no doubt will make certain to donˇt overlook this website and provides it a glance on a continuing basis.

156 iNfopssic  
0
 Wow, that's what I was searching for, what a data! existing here at this blog, thanks admin of this site.As a Newbie, I am constantly searching online for articles that can aid me. Thank youThe very best I could do was place myself on the record and hope that either somebody backed out of an order or perhaps a credit card gets declined. A few months later I received the e mail, then a number of more confirming I'd, the truth is, be finding the Sandtrooper: Squad Chief. A transport date followed together with lots of affirmation quantities all of which made me smile and giddy like a bit child looking forward to Santa..Keep working ,terrific job!
 "This team has character," Pelini additional. "Let me tell you, those guys had been hurting after the sport. No one desires to acquire like they do. A great way to hot up a dish is usually to incorporate warming spices and herbs in the cooking process. Cumin is outstanding, as is turmeric, cayenne pepper, chili, cinnamon, cardamom and cloves. Chai tea includes a lot of these spices and is actually a yummy approach to warm your body.Wow! Thank you! I continuously wanted to write on my site something like that.This is really interesting, You are a very skilled blogger.The web site loading pace is amazing.
 Hello.This post was extremely interesting, particularly because I was investigating for thoughts on this subject last Thursday.I feel very much blessed to have encountered your webpage and look forward to really more excellent times reading here.This is not so. Part-time organizations can begin on a fraction of that of a full-time company. Part-time organizations are exempt from many from the start-up fees that a full-time company incurs. For a practical but fun appear, try the Wallingford rain boot. This Wellington-inspired rain boot is lined in sheepskin with a rubber outsole. The higher boot is created from Ugg"s signature emblem pattern that contrasts together with the metallic-colored higher.Definitely, what a magnificent site and enlightening posts, I surely will bookmark your site.All the Best!

155 iNfopssic  
0
 " by Edith Sodergran.|"Everyone is responsible and no one is to blame." by Will Schutz.|"Cultivation to the mind is as necessary as food to the body." by Marcus Tullius Cicero.|"The very ink with which history is written is merely fluid prejudice." by Mark Twain.|"There is a time for many words, and there is also a time for sleep." by Homer.|"Men must be taught as if you taught them not, And things unknown proposed as things forgot." by Alexander Pope.|"'Tis our true policy to steer clear of permanent alliances with any portion of the foreign world." by George Washington.|"The more sand that has escaped from the hourglass of our life, the clearer we should see through it." by Jean Paul.|"A creative man is motivated by the desire to achieve, not by the desire to beat others." by Ayn Rand.|"Quit worrying about your health. It'll go away." by Robert Orben.|"Patriotism is often an arbitrary veneration of real estate above principles." by George Jean Nathan.|"The word 'genius' isn't applicable in football. A genius is a guy like Norman Einstein." by Joe Theismann.|"The only winner in the War of 1812 was Tchaikovsky" by Solomon Short.|"The man who fights for his fellow-man is a better man than the one who fights for himself." by Clarence Darrow.|"So full of artless jealousy is guilt, It spills itself in fearing to be spilt." by William Shakespeare.|"If you would know strength and patience, welcome the company of trees." by Hal Borland.|"My dear and old country, here we are once again together faced with a heavy trial." by Charles De Gaulle.|"There can be no real freedom without the freedom to fail." by Erich Fromm.|"It is a great thing to know our vices." by Cicero.|"One of the greatest pains to human nature is the pain of a new idea." by Walter Bagehot.|"Character is much easier kept than recovered." by Thomas Paine.|"The achievements of an organization are the results of the combined effort of each individual." by Vince Lombardi.|"Yield not to evils, but attack all the more boldly." by Virgil.|"If you see a snake, just kill it. Don't appoint a committee on snakes." by H. Ross Perot.|"Show me the man who keeps his house in hand, He's fit for public authority." by Sophocles.|"Her grandmother, as she gets older, is not fading but rather becoming more concentrated." by Paulette Bates Alden.|"Marriage love, honor, and negotiate." by Joe Moore.|"A physicist is an atom's way of knowing about atoms." by George Wald.|"Money is power, freedom, a cushion, the root of al evil, the sum of all blessings." by Carl Sandburg.|"Never trust anybody who says 'trust me.' Except just this once, of course. - from Steel Beach" by John Varley.}I have read this post and if I could I desire to suggest you some interesting things or advice.This is certainly pretty generous with you in giving easily what a lot of folks would have marketed for an electronic book in order to make some money for themselves, mostly now that you could possibly have tried it if you ever wanted.Really the blogging is spreading its wings rapidly. Your write up is a good example of it.
 Cooked meals are necessary to assistance the body's need to have for safety within the colder climate, so winter months is whenever we should be consuming the richest, warmest, heaviest foods. It is also *gulp* a time whenever we have a tendency to put on an additional kilo or two for "insulation". Portion handle is truly crucial throughout this time, remembering that a part of salad is probably much less than 50 percent the kilojoules of a casserole or stew in the same dimension."There used to be a real me, but I had it surgically removed." by Peter Sellers.Because the preliminary clusters of sightings through the seventies, there have been sporadic reports in the creature. In 1991 the creature was reportedly noticed leaping from a bridge. There have been forty noted sightings in 1997 and, in 1998, the creature was reportedly sighted within a dry creek mattress 5 miles (eight km) south of Fouke..It includes fastidious information.
 I require an expert in this house to resolve my problem. May be that's you!Keep up the great work , I read few content on this web site and I believe that your website is really interesting and has got lots of good info .Some truly wonderful info , Gladiolus I observed this. "With silence favor me." by Horace.Great info and right to the point.

1-10 11-20 21-30 ... 151-160 161-164
Solamente los usuarios registrados pueden añadir los comentarios.
[ Registrarse | Entrada ]
Secciones
Encuentralo
Aviso
  • Cree su sitio
  • Encontrar por fecha
    Calendario
    «  Junio 2010  »
    LuMaMiJuViSaDo
     123456
    78910111213
    14151617181920
    21222324252627
    282930
    Agrega la web
    Formulario de entrada
    Estadística

    Total en línea: 2
    Invitados: 2
    Usuarios: 0
    Nube de tags
    Nuevo!
    toolbar powered by Conduit