How to Open Files and Folders in CMD on Windows

Open Files on Windows PC using Command Prompt. Here is the Detailed Guide to Open Files and Folders in CMD on Windows 11.

In this guide, I have explained how to open files on Windows 11 using Command Prompt. You can also perform various other tasks related to files such as deleting a file or copying a file in a folder. Using Command Prompt, you can also access folders on your PC hard drive.

To perform any action with files or folders on Windows 11, you do not need administrator access to Command Prompt. Most Windows users prefer File Explorer to access their hard drive content. However, it is equally convenient to manage file operations on Windows using the Command Prompt.

How do you Open a File using Command Prompt?

You have to enter the complete path of the folder where the file you want to open is located. Here are the steps for you. Follow the screenshots to implement the commands with ease.

  1. Launch Command Prompt. Press Win + S hotkeys and type cmd in the search box.
    launch-command-prompt in Windows 11
  2. Enter the path of the folder and press enter to access it.
    cd"folder_path"  [replace folder path with the actual path name]
  3. Once the folder access shows up, enter the file name in double quotes.
  4. Press the enter key to execute the command.
    open a file using command prompt

NOTE: In the above steps, when you are entering the folder path, make sure to wrap it within double quotes.

I am accessing a folder named “c language notes” in the above screenshot. Within that folder, I have opened a file named “comments.jpg”.

How do you Delete One or More Files in Windows 11 using a Command Prompt?

To permanently delete one file or all files in a folder,  you can use the Command Prompt.

Deleting a Single File

  1. Open Command Prompt on your PC.
    launch-command-prompt in Windows 11
  2. Enter the folder path in which the file is located.
    cd "folder_path"
  3. Provide the following command to delete a file.
    del "filename.extension"

    delete a file in Windows using Command prompt

NOTE: The filename and its extension must be wrapped within double quotation marks in the above command.

Delete All Files in a Folder

To delete all files within a folder using Command Prompt, follow these steps.

  1. Press Win + R followed by typing cmd. Press enter to open the Command prompt.
    open command prompt
  2. Enter the command.
    del "folder_path"
  3. Press enter.
  4. Press Y to proceed with the deletion or Press N to abort the action.
    delete all files in a folder using command prompt

The delete command followed by the folder path will delete all the content within that folder. Remember that this action will permanently remove the files from your PC drive. You cannot revert this action.

Copy a File Using the Command Prompt

To copy a file from a folder, you have to access the folder by specifying the folder path. You can then initiate the command to copy a file.

  1. Press the Windows key and type cmd in the Windows search.
  2. Click Open.
    launch-command-prompt in Windows 11
  3. To access the folder, enter the command and press enter.
    cd "folder_path"
  4. To copy a file, provide the following command.
    copy "filename.extension" "destination_path"
  5. Press enter to execute the command.
    copy a file using Command prompt

The destination path is the folder to which the file will be copied. If the destination folder already has a file of the same name as the one being copied, you will come across a prompt.

Press Y to proceed with copying the file and overwriting the existing file of the same name in the target folder. To cancel the process, press N on your keyboard.

Move a File Using Command Prompt

  1. Press Win + S to bring up the search console and type cmd.
  2. Click Open.
    launch-command-prompt in Windows 11
  3. To access the folder, enter the command and press enter.
    cd "folder_path"
  4. To move a file, enter the following command.
    move "filename.extension" "destination_path"

    move a file using Command Prompt

Even while moving a file across folders, if another file is in the target folder of the same name, you may overwrite it or cancel moving the file.

Frequently Asked Questions(FAQs)

Is Opening Files and Folders on Command Prompt Supported on All Windows OS?

Yes. You can open files and folders using Command Prompt on any Windows OS,

Do I need to use Command Prompt with Administrator Access to Open Files or Folders?

Using general access and administrator privilege, you can open files and folders on Command Prompt.

The Commands to Open Files or Folders are not Working on CMD

Always keep the folder path and filename(with extension) within double quotes in a command. Make sure to check the spelling of the filename before executing the command. Also, enter the correct path of the folder.

Bottom Line

If you are looking for creative ways to manage basic file operations or view a file on Windows, I suggest using Command Prompt. Accessing and managing files will be a breeze on the command line tool as long as you issue the correct command with proper syntax.

If you've any thoughts on How to Open Files and Folders in CMD on Windows, then feel free to drop in below comment box. Also, please subscribe to our DigitBin YouTube channel for videos tutorials. Cheers!

Share
Swayam Prakash
Swayam is a professional content creator with 6-years of experience in conceptualizing, creating, and managing tech-based content for notable online publishing firms. At DigitBin, he creates quality-rich and simple content related to Windows OS, Android, iOS, social media, cloud computing, and other general consumer technology. Contact Me on Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *