1. #1
    Unregistered

    How to delete Folder’s content using command prompt in windows 7?How to delete Folder’s content using command prompt in windows 7?

    I am a Hardware and Networking engineering. I am asking this question because it was asked to me in interview. Suppose that you have a folder having some contents.You are asked to delete the contents without deleting the folder and you can’t use mouse i.e through command prompt. Then what will you do? I was speechless. Now I want to know the answer for the same. Please help.



  2. #2
    abhiabhishek Array
    Join Date
    Aug 2012
    Location
    hyderaba
    Posts
    198

    Re: How to delete Folder’s content using command prompt in windows 7?How to delete Folder’s content using command prompt in windows 7?

    Hi friend,
    Open the Run box (Start, R);
    type "cmd" in the Run box and click OK.
    In the DOS window that opens, use "cd\" to move to the root directory (command line will say only "C:\>".
    Now type "cd [name of folder from which you want to delete files]", substituting the actual name of the folder
    e.g., "cd\foldername" -- and hit enter. Then type "del *.*".
    You will be asked if you're sure. Hit the 'y' key. All files will be deleted.


    regards.........

  3. #3
    kumar12337 Array
    Join Date
    Sep 2012
    Location
    hyd
    Posts
    1,989

    Re: How to delete Folder’s content using command prompt in windows 7?How to delete Folder’s content using command prompt in windows 7?

    hi dear friend..............to delete the folder content


    first press the windows key + r and type in the run box as CMD and press enter key

    then the command prompt window will be opened

    after that type the command cd/ and press enter key

    after that go to the location of folder by the CD command

    ...for example the folder name is kumar and it is on the desktop and it contain the text file content and the file name is 123 then type like this.....

    C:\> cd users ( press enterkey)

    c:\> \users> cd "your user name" and hit enter

    c:\> \users\sunny> cd desktop and hit enter

    c:\> \users\sunny\desktop> cd " folder name" and hit enter

    c:/> \users\sunny\desktop\folder name> del 123.txt and hit enter

    then the txt file in the folder will be deleted..............THANK YOU

+ Reply to Thread

Similar Threads

  1. Replies: 9
    Last Post: 25-08-2013, 01:13 PM
  2. Replies: 9
    Last Post: 30-11-2012, 08:50 AM
  3. Command Prompt issues in HP desktop with windows OS
    By Unregistered in forum Windows Forum
    Replies: 2
    Last Post: 12-10-2012, 08:01 PM
  4. Replies: 10
    Last Post: 27-09-2012, 08:54 PM
  5. Replies: 2
    Last Post: 12-09-2012, 10:06 PM