MS DOS Tutorials – How to Create, Delete, Change, Rename Directory and Files


MS DOS Tutorials – Learn MS DOS with an ease
This tutorial will show you how to create or change or delete or rename a directory (called a folder in windows) and how to create sub-directories within a directory, and how to check the list of directories present in your working directory

How to print something on the screen in MS DOS ?

echo – mainly use for displaying or printing messages alternative use is to on/ off the prompt message
echo [message] -> will print the message

echo [on | off] -> will set the prompt on or off
you can check your echo settings by simply writing in the echo command in your prompt

How to create a directory in MS DOS ?
md techytuts
the above command will create a directory with the name techytuts

How to change the present working directory in MS DOS ?

MS DOS is a single taking operating system. You can work with only 1 file/folder at a time and to work with a particular file/folder you first need to open it as you do in Windows. This navigation is achieved through the CD command. However changing through drives don’t require any commands. By default you will be in C:\ drive in your my documents directory. To simply change to D Drive write in d: and press enter. Similarly write e:, f: for changing to e drive and f drives respectively..
cd [directory name]
(cd followed by 2 periods takes you one level up i.e to the parent directory)
cd..
(cd followed by backslash periods takes you to the top directory i.e directly under the drive)
cd\

How to delete an directory in MS DOS ?

To delete a directory
rd [directory name]

rd sample
The above command will delete the directory named sample from the present working directory if it exists

How to know the number of files and directories in the present drive ?
dir -> shows the number of directories in your present working directory

dir /d -> to display the output in column wise order

dir /w -> to display the output in page wise order asking for your requisition to continue
How to rename a directory or file?
ren [old name] [new name]-> used for renaming a file or directory

rename [old name] [new name] -> used for renaming a file or directory
for example if you got a file named one.txt, then to rename this file to two.txt write the below command
ren one.txt two.txt
How to create files and sub-directory in a directory ?

As we know, the command used for creating the directory is md. The same command applies for creating a sub – directory however in this case you need to change through the working directories to create sub directories.

cd [directory name] -> this command will enter into the directory which is present in you drive

The next tutorial will be on how to create a file how to move a file and how to add text in a file and finally how to view this text file in ms dos till then have a nice day. And please do write a comment. Your comments helps us improve.

Related posts:

  1. MS DOS Tutorials – Learn MS DOS with an ease
  2. How to create or delete a System Folder Named CON in Windows XP
  3. MS DOS Tutorials – How to change colors in DOS prompt
  4. How to create Ebooks and PDF Files using Google Docs
  5. How to create Zip/Compressed archives in Windows XP


The author is a small business owner himself specialising in Web Development. He runs Insight Studios which offers specialized Web Development, SEO Services and PPC Management for Small Business and SME thus ensuring growth and prosperity using the power of social media.

Share This Post

Related Articles

20 Responses to “MS DOS Tutorials – How to Create, Delete, Change, Rename Directory and Files”

  1. Andy Wright says:

    Thanks for such a detailed post on all these small issues.It really is very useful for people who are new to this field and are willing to learn more about DOS

  2. raj ashay says:

    well it is a nice work and am very thankful to u
    and i am willing to learn more abt dos

  3. X-chan says:

    Very helpful, just a pity that you didn’t provide anymore examples, as I had to try in a dummy folder first before trying any of the commands somewhere else. Adding a usable example i.e. ren oldwindows newwindows after the commands list would be nice. ^^

  4. arpita.p says:

    very useful.i would like to learn more abt dos commands

  5. William says:

    good!

  6. edjeanabeth says:

    very good and essential to all of the students who are searching this site

  7. aridee says:

    help me pls.. how bout renaming a file name that has a space on it.. hope u get my point..

    example: “help how.exe” to “any.exe”

    “helphow.exe” to “any.exe”

    thnx in advance..^^

  8. Atif says:

    You answered your own question. You (double quotes)

    rm "help how.exe" any.exe

    Should work

  9. jayant says:

    thanks for the tip. can u tell me how to come out of the directory after going into it. i.e.
    c:\windows\my documents\
    now i dont knw how to come back to ‘windows’ diretorylike this
    c:\windows\

  10. Atif says:

    try this
    c:\windows\my documents\> cd..

  11. Emil Rumpleschlaggan says:

    HI, I’m trying to write a bat file to access the dir of any folder using MS-DOS Win98se.
    So that, I have D.bat in C:\, (or C:\Windows) which when launched from any folder by me would
    list dir contents of that folder. So that in C:\Temp, i’d type D (return key) and the dir of
    C:\Temp is displayed. Dir /o/b %CD% Only works in WinXP or above. Thanks a BIG Bunch!!

  12. Atif says:

    Hello Emil,

    This sounds simple to me, create a new file d.bat
    The file should contain only dir or dir along with any switch you would want.
    Then save it inside your system32 folder (c:\windows\system32) so that you can access it anywhere in Command Prompt.

  13. Emil Rumpleschlaggan says:

    Hi Atif,

    A bat file (D.bat) which will list Any Folder’s dir. Or, list dir of Any folder.
    Works Perfectly – in Windows, however, not using it in Windows,
    but, MS-DOS ONLY (Win98se DOS). Any other ideas.
    Thanks. Emil

  14. shareef says:

    I know to create a dir after that how to access that particular dir and its files please help me out…

  15. junkiest says:

    Nice tutorial…. thanks !!!

  16. Rob says:

    This was helpful. Thanks for posting.

  17. Jonathan says:

    hai i have read your tutorial and it helps me much, ahm well in deleting a file u said it is rd is there any other commands for deleting a file? because when i use the del it still delete the file

  18. Jonathan says:

    ouch sorry my bad.. i didn’t notice . . you have posted there is deleting a directory i didn’t notice my bad,.. sorry :)

  19. Atif says:

    no problem :-)

  20. Wil Niba says:

    Hi Atif,

    In Windows 7 I’m trying to make a syntax with xcopy.
    I want to make a dayly copy only for the newer files etc.
    No problem, except for the folder My documents.
    (In Dutch: when I open Exploere: Bibliotheken/ Mijn documenten)
    But I cannot find the folder.
    I put the folder My documents in a separate partition d:
    Can’t find it in xcopy either.
    I tried c:\users\public and gave the dir – command.
    no result.

    can you help me?

Leave a Reply

© 2012 MyGeekPal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Designed by Insight Studios