TechiWarehouse.Com


Top 3 Products & Services

1.
2.
3.

Dated: Aug. 12, 2004

Related Categories

DOS
Command @
Description Do not echo this line.
Syntax @ command line
Typical Use To hide a single line if echo is switched on, or to hide the switching off of the echo command.
Example echo This line will be echoed twice to the screen,
@echo Whereas this line will occur only once.

Command ECHO
Description The ECHO command has several different uses. MS DOS batch files use two echo 'modes'. The default echo mode is ECHO ON. When ECHO is set to ON, every command in the batch file is displayed to the screen before it is run. Sometimes this information is not required, and can even be downright annoying for larger batch files. The command ECHO OFF sets the batch echo mode to OFF. In this mode, the commands are not printed to the screen prior to their execution.
As well as the echo modes, the ECHO command is used to print a message to the user. Messages are displayed to the user by preceding a line of text with ECHO.
Syntax ECHO MODE ON : ECHO ON
ECHO MODE OFF : ECHO OFF
DISPLAY A MESSAGE : ECHO message
Typical Use The command @ECHO OFF is almost always placed at the top of a batch file to switch off subsequent command echo.
ECHO is also the only way a batch file can communicate information to a user.
Example @ECHO OFF
ECHO Please insert a disk in drive A: and press any key when ready.

Command REM (short for remark)
Description REM is the MS DOS batch file method of providing comments. Comments are lines of code which are not executed by the batch file, but rather are used to convey information about the workings of the batch file itself. Good batch file programming practice demands a comment at the head of every batch file explaining its use and syntax. Comments can also be put in other parts of the file to clarify ambiguous commands and to 'comment-out' a line of commands so that they are temporarily ignored by the batch file.
Syntax REM line containing comment.
Typical Use REM should be used at the top of every batch file to provide a description and example use. However, too many REM lines are not an example of good programming style! Don't provide a comment for obvious commands - only the tricky ones!
Example REM SFORMAT.BAT : Safe Format
REM
REM This batch file implements a safe version of the format command.
REM The C: drive can not be formatted with this command.

Command PAUSE
Description The PAUSE command prints the message "Press any key to continue..." to the screen and waits for the user to respond.
Syntax PAUSE (it's as simple as that!)
Typical Use The PAUSE command was the only method of getting a user's response in batch files until the choice command arrived in MS DOS 6.x. By issuing instructions with the ECHO command, the PAUSE command waited for the user to read them and respond appropriately.
Example ECHO Please insert the disk in drive A: and
PAUSE

Command GOTO
Description The GOTO command allows a batch file to branch to a different location to continue executing commands from. To tell the batch file where to go to, a label is placed after the GOTO command. This label must conform to several guidelines for it to be a valid batch file label.
Syntax GOTO label
Typical Use Until MS DOS 6.x introduced the FOR command, the GOTO command was a batch files only mechanism of performing a command repeatedly. GOTOs are still the only method in a batch file to perform a sub-set of commands. (MS DOS Batch files do not have sub-procedures)
Example IF %1 == "" GOTO ERROR

Command IF
Description The IF command is used in batch files to test whether a condition is met or not. This allows the batch file to perform a particular action only if a particular condition is met. There are several different variations of the IF command: IF EXIST, IF ERRORLEVEL, and IF x == y (yes! it does use two equal signs!)
Syntax IF EXIST filename or dirname : used to test for the existence of a file or directory in MS DOS. This test will return true if the file does exist.
IF ERRORLEVEL : After a program has finished executing in MS DOS it returns a value to the operating system indicating its success or failure. This value is stored in the variable ERRORLEVEL. By testing this variable, a batch file can deduce the result of the program that just finished running.
IF x == y : This version of the IF statement tests two string values. If string x is equal to string y this test is evaluated to be true, otherwise false.
All of the above IF statements can also be negated with the NOT command. For example -:
IF NOT EXIST filename : Tests to see if the file doesn't exist. This test will return true if the file doesn't exist.
Typical Use The IF statement is one of the most useful batch file commands, and as such is probably the most common. The IF EXIST command is used to check if a file exists before it is copied/moved/opened/etc. The IF ERRORLEVEL allows a batch file to check the return value of another program. The IF STRING1 == STRING2 is commonly used to validate command-line parameters.
Example IF NOT EXIST %1 MKDIR %1

IF ERRORLEVEL 2 GOTO END

IF %1 == "" GOTO ERROR


Command SHIFT
Description The SHIFT command is possibly, at first, the most confusing batch file command. It needn't be. Simply, the SHIFT command increases the number of command-line parameters accessible by a batch file. Each time SHIFT is called, the value in the 1st parameter is discarded and replaced by the value of the 2nd parameter. The value in the 2nd parameter is replaced by the value in the 3rd parameter, etcetera, etcetera, until the 9th parameter is replaced by the previously unavailable 10th parameter.
Syntax SHIFT
Typical Use The SHIFT command provides considerable power to batch files. It allows a batch file to operate on an unknown number of parameters. The SHIFT command is often used in situations where an operation needs to be performed on several files or directories.
Example The following example displays the contents of the files typed after the batch file name one page at a time.

:LOOP
TYPE %1 | MORE
SHIFT
IF "%1" == "" GOTO END
GOTO LOOP
:END


Command CALL
Description The CALL command is used to run another batch file from within a batch file. Execution of the current batch file is paused and the called batch file is run. After the called batch file has finished running, the original batch file is resumed at the line after the CALL statement.
Note: If another batch file is run from within a batch file by simply using its name, after the called batch file finishes executing, control is returned to the Command Line, NOT the original batch file.
Syntax CALL batchfilename [parameters] [switches]
Typical Use The CALL command is used to provide modularity to batch files. Batch files can be re-used effortlessly if they are written with modularity in mind.
Example IF %1 == A: CALL FLOPPY.BAT

Command FOR
Description The FOR command was an invaluable addition to the DOS Batch File Command suite. FOR repeats a command for a number of files, directories, or text-strings.
Syntax FOR variable IN list DO command [parameters] [switches]
Where -:
  • variable is substituted for each element in the list and passed to command. Variable has a special format in batch files.
  • list is a list of filenames (wildcards allowed), directory names, or text-strings that are to be processed by command one at a time.
  • command is a DOS internal or external command to be performed for each element of the list.
Typical Use The FOR command performs the same command for each element of a list. Prior to its introduction, the same effect had to be achieved with GOTOs and IFs, which were messy and sometimes difficult to follow. Use a FOR to do any necessary looping in your batch files.
Example The following is an implementation of the same example presented in the SHIFT example of displaying many files to the screen with MORE.

FOR %%f IN (*.*) DO TYPE %%f | MORE

A lot neater, huh?!


Command CHOICE
Description The CHOICE command is perhaps the best addition to MS DOS Batch File commands. CHOICE makes it possible to accept various user-responses. Before now, users were presented with crude either/or choices in batch files. The CHOICE command allows a batch file to detect a users choice from a lits of options.
Syntax CHOICE [/C:choices] [/N] [/S] [/T:choice,timeout] [TEXT]
Where -:
  • /C:choices : specifies the choices that the user can choose from. The choices can only be single characters.
  • /N : Do not display choices and the '?' at the end of the TEXT prompt.
  • /S : Treat the choices as case sensitive, meaning that 'a' is a different choice from 'A'. By default, case is not sensitive - 'a' is equivalent to 'A'.
  • /T:choice,timeout : Default to choice after timeout seconds.
  • TEXT : The text to display as the prompt of the choice.
Typical Use The CHOICE command has its obvious use in batch files. It is now possible to easily get a users response, thus allowing batch files to be much more interactive, and therefore more useful.
Example The following batch file snippet displays a simple menu (without a question-mark at the end of the prompt) and prompts for the users choice, defaulting to option 2 after 5 seconds :

ECHO 1. MS-DOS Editor.
ECHO 2. MS-Windows. (default)
ECHO 3. Defrag the hard-drive.
ECHO 4. Quit.
CHOICE /C:1234 /N /T:2,5 Please choose a menu option.
IF ERRORLEVEL == 4 GOTO QUIT_MENU
IF ERRORLEVEL == 3 GOTO DEFRAG_HD
IF ERRORLEVEL == 2 GOTO RUN_WIN
IF ERRORLEVEL == 1 GOTO RUN_EDIT
:RUN_EDIT
CALL EDIT
:RUN_WIN
CALL WIN
:DEFRAG_HD
DEFRAG c:
:QUIT_MENU
ECHO Safe to switch off machine now...

Batch File Commands

Now that you've gotten free know-how on this topic, try to grow your skills even faster with online video training. Then finally, put these skills to the test and make a name for yourself by offering these skills to others by becoming a freelancer. There are literally 2000+ new projects that are posted every single freakin' day, no lie!


Previous Article

Next Article


Addie's Comment
where to buy viagra https://kauviagra.com/ order viagra online
05 Mon Oct 2020
Admin's Reply:



_____'s Comment
you are actually a just right webmaster. The website loading velocity is amazing. It kind of feels that you are doing any unique trick. Furthermore, The contents are masterpiece. you have performed a great process on this subject! https://uricasino114.com
15 Sat Aug 2020
Admin's Reply:



comment-51465's Comment
I do believe this article is worth attention. These days, it is therefore difficult to find something important online, that Im really surprised to reach this web site. The particular same happened in my opinion when I found https://upliftconnect.com/connecting-our-spiritual-and-human-experience/. I consider the authors are usually quite similar with regards to style. They usually are both damn great. Thanks a great deal, keep writing!
12 Fri Jun 2020
Admin's Reply:



Wilfredo's Comment
Pretty component of content. I just stumbled upon your website and in accession capital to say tgat I get actually loved account your blog posts. Anyway I will be subxcribing for yor augment and even I fulfillment you get admission to consistently rapidly. Adalah pasaran saham yang dibuka pada hujung minggu denyut cryptocurrency https://malaysia-option.com/ethereum-membeli-di-jerman/
04 Thu Jun 2020
Admin's Reply:



______'s Comment
I am regular reader, how are you everybody? This article posted at this site is actually fastidious. https://uricasino114.com
16 Sat May 2020
Admin's Reply:



Dorthea's Comment
slot online kasino casino slots casino slots slot online
31 Fri Aug 2018
Admin's Reply:



Katia's Comment
casino games casino online online casino casino online casino online
25 Mon Jun 2018
Admin's Reply:



Jeannine's Comment
Arquivo com Aparecida. DIAS, Maria Berenice. 1.721). https://sexonanet.net/bm0922-billy-rubens-and-darius-ferdynand-full/
24 Tue Apr 2018
Admin's Reply:



como ganhar dinheiro na internet clicando em anunc's Comment
classe page, sou discordomais uma vez. http://knightbeetle5.soup.io/post/648972172/Tal-como-Acavalar-Um-Di-rio-virtual
20 Fri Apr 2018
Admin's Reply:



� possivel ganhar dinheiro com wordpress tutorial's Comment
Obrigado muito para seu site internet - SIDA muito. http://www.indiandinersw1.co.uk/index.php/component/k2/item/12-content-demo-115
12 Thu Apr 2018
Admin's Reply:



beira Mar imoveis aguas Claras df's Comment
Muito obrigado ! Este um fant�stico webpage ! http://188.166.164.98/index.php/De_Que_Jeito_Comercializar_Im%C3%B3veis_A_Forma_Melhor_Persuasiva
09 Mon Apr 2018
Admin's Reply:



Pedro Vicente's Comment
Acabei de voltar do Afluxo bem como fiz certo bloquinho com suas dicas por bairros que visitei. http://www.clima-safe.com/finding-package-holiday-deals-online/
02 Wed Aug 2017
Admin's Reply:



Paulo Enzo Gabriel's Comment
A corpora��o Saveiros Tour isto no com�rcio mar�timo a datar de 1978 e al�m do tour atrav�s da Ba�a a Guanabara oferece mais servi�os que nem, tendo como exemplo, tour pelas Ilhas Cagarras e tamb�m alquil� a barcos em geral. Conversando com a acompanhador, descobri que nos dias de hoje a briga dos cariocas por passeios mar�timos vem aumento, que me coloca bem abortado, uma vez que � sinal a que estamos valorizando melhor a at� que enfim capital. Outra briga que vem crescido que me chamou muita aten��o � acesso de alugamento a barca�a destinado a afago, tamb�m a fim de casamentos. http://self-help-motivation-source.com/where-to-find-travel-and-tour-services-online/
23 Sun Jul 2017
Admin's Reply:



Jo�o Lucas's Comment
https://plus.google.com/112649256050130119484
23 Sun Jul 2017
Admin's Reply:



Vinay Purohit's Comment
Hi Friends, i want to create a batch file with multiline command. Could anyone help me how to write multiline command in command prompt. Like: C:\ CD TSC\FINAL C:\COPY CON LPT1 DOWNLOAD ARIAL10B.VF1",5493,^Z C:\COPY CON LPT1 MOVE ^Z C:\
07 Tue Aug 2012
Admin's Reply:

Vinay, I may be totally off the question, but just adding a line break does the trick like this:

Command1
Command2

For example:

CD C:\
DIR




chancesilver's Comment
Dear Admin, regarding my earlier post, I think I have figured it out. Closely looking at the results of my command before the pipeline, I noticed that the conditions for DO command were met twice. In my case I was searching for a string "0.0.0.0" which appeared a couple of times when you do router print.
13 Mon Feb 2012
Admin's Reply:

Thanks for sharing Chance. I realized after you informed me. Sorry it took so long to answer back.




chancesilver's Comment
FOR %%f IN (*.*) DO TYPE %%f | MORE regarding above, I keep getting results twice. I have experimented with this and any command I use after DO seems to be running twice. Can you advise why ? very useful site, ta
10 Fri Feb 2012
Admin's Reply:

Same on my end. Not sure why, I'll have to play around with it.




dez's Comment
unfortunatley, i cannot, i had a drive malfunction and lost it (the batch file mentioned above in previous message)
09 Mon Jan 2012
Admin's Reply:

 sorry to hear that dez :( 

I was waiting to learn somethig new. but hey no problem. that is part of life. you can do it again and then share with us.




Alex's Comment
Oh, nevermind, I didn't put the ERRORLEVEL in descending order... Sorry for cluttering the comments.
16 Wed Nov 2011
Admin's Reply:

 :)




Alex's Comment
Hello, I've tried putting the choice command in one of my batch files, but whatever choice I hit just skips to the immediate next command in the file, it doesn't "goto" the required point in the file. Here's a sample: @echo off :begin cls start /d "A:\Ntreev\Grand Chase\" grandchase.exe start /d "C:\Users\zanshin\Desktop\Xpadder" Xpadder.exe choice /c:ONA /m "Pour copier la musique CUSTOM, peser sur O pour OUI, sur N pour NON ou sur A pour ANNULER" if errorlevel == 1 goto :one if errorlevel == 2 goto :p2 if errorlevel == 3 goto :eof goto :eof :one xcopy "A:\Ntreev\Music" "A:\Ntreev\Grand Chase\Music" /y /e /k /c /r /s goto :p2 :p2 choice /c:ON /m "Pour copier la musique ORIGINALE, peser sur O pour OUI ou sur N pour NON" if errorlevel == 1 goto :two if errorlevel == 2 goto :eof goto :eof :two xcopy "A:\Ntreev\Music_Bck\Music" "A:\Ntreev\Grand Chase\Music" /y /e /k /c /r /s goto :eof Basically, all it does, whatever key I press is execute all xcopy commands, whatever the choice I make is. Any help would be appreciated.
16 Wed Nov 2011
Admin's Reply:

 Hi Alex

i ll see what i can do with it.




Trevo's Comment
i'm on win7 and i can't get my batch file to worki want to set it up so i give a choice and if depending on what they choice it opens something this is what i have so far @echo off echo do you want to open Paint? choice if errorlevel 1 goto A if errorlevel 2 goto AB pause :A start pause :AB echo testt pause but i can't get anything to work message me if you can help lobovance2@yahoo.com
14 Wed Sep 2011
Admin's Reply:

First of all, you're asking a very relevent question. I say relevent because as time goes on, Micro$oft is making it harder and harder to do batch scripting on it's OS. I'm still happily using WinXP because I consider that the best deal for me. If you want a better DOS Batch environement, you might to want to stick w/ Xp or earlier OS. Each ver. of Windows that comes up further limits it's DOS capabilities. So you might want to think about that.




dez 's Comment
im creating an all-in-one batch script, which i plan to use as a service. BUT, i want to install some extra commands e.g "batch.bat -k" where it runs another label within the same batch, i also want to know what 7/whs2011 's command is to directly kill a program, if you could send me a message, i would be VERY Grateful. ill even show you what im doing, which might help others, p.s im using firedaemon for the custom service install, as its more configurable than the .net command lol
07 Wed Sep 2011
Admin's Reply:

You're more than welcome to copy/paste your batch script here for all of us to learn from.




Jeff's Comment
you can launch the default browser by doing the following. start http://www.msn.com for example
14 Sun Aug 2011
Admin's Reply:

well jeff you are right we might try it as well but i never checked it my self why don't you give it a try and share your experience with us. however i use the run command to open a website and it works for the default web browser.

 




Pete's Comment
Hy i was wondering is it able to write a batch file that would open a specific content on a web page?
02 Sat Jul 2011
Admin's Reply:

I've not seen it done, but I have a strange feeling that it's possible. There must be some IE related command lines to make that possible for you.




bhargavi's Comment
I am new to this batch file,thanks this is very helpful for me.............
21 Tue Jun 2011
Admin's Reply:

Bhargavi, it doesn't end there. I literally perform magic with my very basic batch scripting know how. Imagine what you can do with advanced skills.




BOB's Comment
this is kool
15 Tue Mar 2011
Admin's Reply:

Thanks Bob.




DENAK's Comment
@echo off echo WARNING VIRUS HAS BEEN DETECTED echo System check echo - echo Power - FAILED echo - echo RAM - FAILED echo - echo Norton - FAILED echo - echo Breach of IP adress echo - echo Firewall - FAILED echo - echo Virus attaining: ****-****-****-8894 echo - echo Hard drive must be erased and rebooted to resume windows. echo - PAUSE echo - echo Starting to reboot hardrive. echo - echo Do not attempt to quit. echo - echo Restart after 10 minutes approximately. PAUSE :START start Internet Explorer.bat GOTO START
10 Mon Jan 2011
Admin's Reply:



UMESH TOMAR's Comment
niceeeee
23 Thu Dec 2010
Admin's Reply:

Thanks




coollegs's Comment
please i would like to have the script as soon as possible the sooner the better.
21 Sun Nov 2010
Admin's Reply:



Domenico's Comment
sorry guys, this feedback form cuts all carriage returns. you will have to find out yourself where they are....:-( or email me for a nice .bat format file.
20 Sat Nov 2010
Admin's Reply:

Sorry about that bro.




Domenico's Comment
first of all I thought I would do a favour to everyone and tell where to download the choice.com if you don't have it on your machine: Here one of the old official site: http://support.microsoft.com/kb/117600 Then, I wold like to share a much more elegant way of writing a choice batch file: @echo. @echo starting choicebat program ... @echo. @echo. @ECHO choose the POD you want to run this batch against... @ECHO. @ECHO 1. POD1 @ECHO 2. POD2 @ECHO 3. POD3 @ECHO 4. POD4 @ECHO 5. ALL POD's, one at the time (Default after 15 secs) @ECHO 6. Quit @echo. @echo. @CHOICE /C:123456 /N /T:5,15 Please choose an option. @echo OFF IF ERRORLEVEL == 6 GOTO salute IF ERRORLEVEL == 5 GOTO PODx IF ERRORLEVEL == 4 GOTO POD4 IF ERRORLEVEL == 3 GOTO POD3 IF ERRORLEVEL == 2 GOTO POD2 IF ERRORLEVEL == 1 GOTO POD1 @echo. @echo. :POD1 call bla1 GOTO :salute :POD2 @echo ciao bellissimo GOTO :salute :POD3 CALL bla3 GOTO :salute :POD4 CALL bla4 GOTO :salute :PODx CALL blax :salute @echo ON @ECHO exiting completed successfully choicebat now...
20 Sat Nov 2010
Admin's Reply:

That is some sweat script. I'll explore it some more, thanks.




Joe's Comment
Im trying to write a batch file to open command promp and go to a drirectory and start my server for a game but i need it to start the server and add a command. basicly i open cmd myself add a directoey to my server then i type the file with a few atributes behind it and it starts. is it posible to write a batch file to do that.
15 Mon Nov 2010
Admin's Reply:

My gutt feeling is "Absolutely".




coollegs's Comment
i mad a security software and i have 1 issue it needs a way for people to input there password for instance joeys comment would be helpful for a actual script because i need it to complete Safe Lock[+] if u or any one could tack the time and male it for me it would be very much appreciated. Coollegs
12 Fri Nov 2010
Admin's Reply:

Some Day




Lohith S's Comment
Do we have anything called sleep command or do we have to install the sleep.exe and only then issue sleep in out batch scripts.
04 Thu Nov 2010
Admin's Reply:

Sorry, I have no idea of anything about sleep command.




joe's Comment
hey i was wondering if it is possible to make a batch file change itself depending on what the user types in (set/p). i wanted to make a save and load script for my game. i was thinking the user would type in their name, the batch would save that name to a folder or something, then if i closed the batch, opened it again, and typed in that name, it would load that file and stats that were set the last time that user played the game would be loaded into the batch, by setting certain variables. any ideas?
28 Thu Oct 2010
Admin's Reply:

It sounds like it's do-able. But you'll have to play around with it to an intense level.




Jordan 's Comment
hey is there a command that closes things i want to make a file that closes explorer.exe i wanna pull a prank on my freinds
14 Thu Oct 2010
Admin's Reply:

Short answer, yes there is. But you need to explore it for yourself. Tip: it's much easier than people think.




Marcus's Comment
Hey, i needed some help. could you help me to reedit my line? @ECHO OFF :BEGIN CLS ECHO BIOS EDIT VERSION ECHO -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ECHO Which L510 BIOS You Want To Flash? ECHO 1. L510(Motevina) V1.5 ECHO 2. L510(Capella) V1.3 CHOICE /N /F:12 PICK A NUMBER (1 or 2)%1 IF ERRORLEVEL ==2 GOTO TWO IF ERRORLEVEL ==1 GOTO ONE :TWO CD L510 CD 510(C) FLASH.BAT :ONE CD L510 L510V15.BAT i cant get it right =(
12 Tue Oct 2010
Admin's Reply:

Ah, I'm lost with your batch script.




Cesar Nunes's Comment
This one might be tricky: I want to create a batch file to open my cash drawer. I have all dll`s and command lines to load and open it, but it seems I can only do one action at a time (load/open). If I try to open without loading it doesnt open.. The model is GEM3254 (http://www.gerbo.com.br/interna_produtos_detalhes.asp?id=1) I know, it`s not in english, but the dlls and test files are in the bottom of the page. Many Thanks!
07 Thu Oct 2010
Admin's Reply:

You got me Cesar. I have no idea.




Nilesh Chadee's Comment
Thank for your reply. I just want to know if it is possible to perform a full disk clenup using windows disk cleanup. When using sagerun 100 it does not clean compress files. Does anyone know how to do this to create a batch file to make a full disk cleanup.... thank to other comment and guys don run this command ' del %Temp%' its delete all files in your desktop.
02 Sat Oct 2010
Admin's Reply:

It's never a good idea to use del commands in a batch script without being sure what your doing. Thanks for the insight.




Nilesh Chadee's Comment
Does any1 know how to create a Disk Cleanup batch file but must clean all the file. using sagerun:11,60,100 etc does not clean compress file.
28 Tue Sep 2010
Admin's Reply:

if you wanted a simple clean up then you can always use del * in side the folder.




arvin's Comment
yes,it needs to be updated.What we're planning to do is launch a series of new articles and tutorials.This site has collected dust far too long and that's about to change^_^
05 Thu Aug 2010
Admin's Reply:

Arvin, I would love it if you can send me content for this site. If you have something to share on this site, I promise to publish it on your behalf.




sreejith's Comment
hey, where can i find d updated one ,pls email me... i want to know how to lock a folder using batch file,neways thanks!!
16 Fri Jul 2010
Admin's Reply:

Try: Disk Operating System




Michael's Comment
thanks. my bat files kept stopping part way through. The CALL command is what I needed.
12 Wed May 2010
Admin's Reply:

I've seen many people that get similar error or abrupt ends are due to calling another file by a non-DOS format. Make sure you type in the file location properly.




rony's Comment
looks pretty good to start programming on batch files.
07 Fri May 2010
Admin's Reply:

I'm glad you like it. Also, tell your friends about it.




shivanadri naveen kumar's Comment
this articl has more help full me alot and i expect more details on IF condition Thanq
16 Fri Apr 2010
Admin's Reply:

Check out: MS-DOS Command Line Tutorial




rajeswari's Comment
hi, i am new to the batch file coding can you explain me how a file in a particular folder can be transfered to another folder thanks
16 Fri Apr 2010
Admin's Reply:

Check out: MS-DOS Command Line Tutorial




Jason's Comment
Thank you for the detailed explanation of the Batch Commands. I was wondering if it was possible to move files into folders by using the 'IF' statement. I have image files numbered sequentially. An example: move pinic001.jpg Photos01 The range of files should be a variable. I have about a hundred photos to be moved into the folder "Photos01". Can't keep giving the same command again by changing the last digit. Can that be set as a variable? Thanks, -Jason
13 Tue Apr 2010
Admin's Reply:

Well I'm no expert, just someone trying to help others as much as I can. My gutt feeling is you can do it. I think you can set it as a variable. However, what I sometimes do in a case like this is to use MS Excel. It saved my behind on many occasions.




vignesh's Comment
Hi its very much helpful for the beginners and i just want to know that is there is any batch command for retrieving Data from database.please help me.
30 Tue Mar 2010
Admin's Reply:

I wouldn't honestly know how...but I know that if the db is a txt flat file...there is a way using batch scripting.




Dakota's Comment
I'm writing a script to add a file to users desktop everytime they login. I need to know what the "IF" syntax to check to see if the file exists and if so, over write. This file is updated daily so a shortcut will not work. Thanks,
30 Tue Mar 2010
Admin's Reply:

Would you show us an example of your script so that we can better comment / give help from? Also, there are plenty commands that use the /q or the quite mode which doesn't ask for replace yes or no questions. I'll need to see the script to be more helpful.




Hardik's Comment
can i create a batch file for autometic login in my software with batch file,, If it is possible than plss give me tips....
26 Fri Mar 2010
Admin's Reply:

In Short: NO!

You're DOS Batch script will be limited to what you can do with manually typing dos commands. Unless it's been pimped out to an outragous degree. But even it's been elegantly programmed, it wont login to anything. Unless your software can be used through command line.




SenHu's Comment
Glad to see this article. It is helpful. Me and my students have been using biterscripting ( http://www.biterscripting.com ) for a while instead of DOS. It is more close to UNIX shell scripting, and thus has more flexibility. Feel free to check it out.
16 Tue Mar 2010
Admin's Reply:

thanks, thats good to know something new, we will check and might add a new article based on it possible




sriraag's Comment
it is very useful but i think QBASIC is a little easier.also add some more examples
16 Tue Mar 2010
Admin's Reply:

yes we are working on it




kyle kolenc's Comment
on the school computer it says that choice is not a valid command is it just the schools computer?
02 Tue Mar 2010
Admin's Reply:

i think in your school they are using Windows XP as OS, if that's the case try this

set /p instead of choice




dalubhasa333's Comment
i want to learn more batch command and batchfile programming. i wan to create a virus that will melt all your system and bring your hard drive to hell thats what im talking about. har har har har
02 Tue Mar 2010
Admin's Reply:

Wow, you must have a lot of time on your hands




ASHVIN PATEL's Comment
sir now we are manage batchfile details are as under : 1.ECHO OFF, 2. PROG1.EXE +X two statement only but i dont know "+X" uses and i need EXE file speed
27 Sat Feb 2010
Admin's Reply:

not sure about the same speed but it should do the trick.




Alan's Comment
Re: Joey's Comment Echo messages will display. Only command echoing is off.
19 Fri Feb 2010
Admin's Reply:

Thanks for sharing Alan.




Joey's Comment
Hey, im just starting batch file coding. When i have echo off, does that mean my echo messages wont show?
01 Mon Feb 2010
Admin's Reply:

yes, it is used to turn off the following echo command.




Ubbe's Comment
If i have an function i done in c++ i want to return an value that can be reused in dos-batch. Does anyone knows?
20 Wed Jan 2010
Admin's Reply:

Hmm, your question seem valid but my experience with Windows based batch scripting is that it's very limited in it's capabilities. So you might have to dumb down your C++ script and maybe then convert to batch scripting.




ryan miller's Comment
whenever i use this methid for the choice command it says: "environment variable /n not defined"
29 Sun Nov 2009
Admin's Reply: keep in mind...due to various windows versions, Micro$oft in all it's wisdom decided to limit the dos commands available.



Mejo Koshy's Comment
Need More Commands to illustrate !!
26 Thu Nov 2009
Admin's Reply: I agree. It would so much more useful. Let me know if you can submit more commands, I'll be happy to return the favor by posting your link :)



admin's reply's Comment
good =]
20 Fri Nov 2009
Admin's Reply:

Sorry to burst your bubble buddy. But aaahhh, you're not an admin here.

Salutations to you just the same




NILESH 's Comment
nice,but i need more command
07 Sat Nov 2009



Manjunath's Comment
I want to learn batch scipting
27 Tue Oct 2009
Admin's Reply:

You might want to check out: Practical Batch Tutorial




Yuiron's Comment
Tanks alot I've been studing on this for 5 days it very good but hard =)
26 Mon Oct 2009
Admin's Reply:

If you go slow but try to understand it the concept, Batch scripting is just as easy as HTML.




Tim's Comment
the command choice no longer exists in win xp and above
21 Wed Oct 2009
Admin's Reply: yes, it needs to be updated. What we're planning to do is launch a series of new articles and tutorials. this site has collected dust far too long. and that's about to change :)