febooti softwarehome of febooti softwarefebooti software

MS-DOS prompt command basics (continue)

Batch files
homenewsproductsdownloadsorderingsupportcontacts
show Quick Links
hide Quick LinksQuick Links: Command line email home | Online help | Commands | Batch files | FAQ | Buy now | Download


Another common command is CD. This changes the directory you are currently in.

C:\>CD \windows\security
Type text Copy text

This example might not work for you as this is program specific however the scheme is still the same. You have to type CD (Change Directory) followed by the root, the first \, followed by the first directory under the root, windows, followed by the next directory, security. You would keep doing this until you got to your last directory.

One more useful command is being able to create directories. Directories are given names just like files are. They can contain numbers and letters but be careful of some of the special characters. When you make a directory try to avoid adding an extension. To make a directory, use the MD command. The following shows how.

C:\>MD directoryname
Type text Copy text

Have you ever copied and pasted a file from one folder to another? Maybe you just copied and pasted a snippet of text or a picture to another file. Suppose you wanted to copy a file and make a duplicate of that file with a different name. In the next example, we have 2 files. The contents are the same as we are creating a Document2.doc using our existing Document1.doc.

C:\>COPY Document1.doc Document2.doc
Type text Copy text

All that you have to do for the copy command to work is place the original file's name first. Press the space bar. Then put what you wish to name the new, copied, document. This is a good simple way to make a backup file. There are typically two messages that will come back - 1 file(s) copied or File not found. You can always use the DIR command to make sure you have the correct filename. Experiment with using different drive letters and directories using the same principles we used to create and change directories. To copy a group of files you can use what is called the wildcard. Here is an example:

C:\>COPY *.doc a:
Type text Copy text

In this example the *.doc matches all the files ending in .doc in that directory. Be careful with the wildcard when deleting files as it is very easy to delete more than what you want to delete.

You can press the Control key and the C key, looks like ^C on most documentation, to stop the batch file from executing. You will then be asked if you wish to terminate the batch file. Press a Y for yes or a N (stands for no) to continue on processing the batch script. You can also use the Ctrl+Break key combination. This combination produces the same output as the Ctrl+C combination.

Something that you might find interesting later on when you learn about the ECHO command is that when you enter ECHO OFF at the command prompt you will in essence "lose" your prompt. You need to type ECHO ON in order to get back to where you were.


Previous DOS batch commandDOS batch command 3 of 11
Return to Origin
Next DOS batch command



Look closer
febooti Command line email client: send mail from Windows command line (MS-DOS prompt)
febooti ieZoom toolbar - zoom IE web site pages
febooti fileTweak - change file date, time and attributes


How to?
How to send command line mail using TO, CC, BCC recipients
How to send email with / from ASP script
Command line email for windows - setting mail priority


Links
febooti software affiliate program
Link to us!
Links


febooti softwarehome of febooti software
back to top
Copyright © 2001-2006 febooti software. All rights reserved.
Copyright © 2001-2007 febooti software. All rights reserved. Last Updated: August 28, 2005