How to find and open files using Command Prompt

Sometimes searching for files on Windows 10 becomes difficult for users who are used to using File Explorer when they only remember a little bit of file information. In such cases, using Command Prompt will help you easily find the file you want. Moreover, Command Prompt also allows you to directly open files from the folder containing them.

How to find and open files using Command Prompt

How to open Command Prompt

Before searching and opening files using Command Promt, you must first open Command Prompt. There are several ways to open Command Prompt that you can use:

  • Press the Windows button to open the Start menu then type cmd, click the first search result to open Command Prompt . You can also right-click then select Run as administrator to open Command Prompt with admin rights

How to find and open files using Command Prompt

  • Another faster method to open Command Prompt is to use Run . Press Windows + R to open Run then type cmdor cmd.exeand press Enter or click OK

How to find and open files using Command Prompt

  • The next way is to use the Power User Menu. Press Windows + X then click Command Prompt (Admin) or press A to open Command Prompt with admin rights
  • Finally, you can command Cortana " open command prompt " to open Command Prompt

How to find and open files using Command Prompt

How to search for files using Command Prompt

In the Command Prompt window that just opened, you type in , replacing search term with the name of the file you want to find. In the example below, Quantrimang tries to search for files/folders named "funvideo".dir "\*search term* /s

How to find and open files using Command Prompt

After you press Enter for about 1 to 2 seconds, the search results will be displayed. All files/folders with names related to funvideo will be listed.

Now let's explain a little about the components in the above statement:

  • diris a command used to display files in the current directory but can also access data anywhere on the computer.
  • The dir command prompt \searches in the root drive of the current device.
  • /sdir command prompt search in all subdrives
  • Finally, the ampersand *is used by command line applications as a wildcard. It signals that the search command will search all file names that contain your search keyword.
  • Add a comma *to the end of the name, like this business*will search all files with the search keyword at the beginning of the name
  • If you put the mark *at the beginning, your search will only include results with the keyword after it. For example *.jpg.
  • If you put the comma *at both the beginning and the end of your search term, you will cover all cases. Whether or not the keyword you entered is the actual name of the file, the file will still be listed in the search results.

Change drive to locate files more accurately

If you save the file in drive D: you will not be able to find it if you perform a search command in drive C:. Therefore, you need to change the directory according to the steps below.

First, type cd..and press Enter to tell Command Prompt that you need to change the drive. Next, to change to drive D, you need to type d:and press Enter . From now on, all commands will be executed on drive D.

How to find and open files using Command Prompt
Quantrimang's machine cannot execute this command because there is no drive D.

Now, you can search for the file you need by executing the command again dir "\search term*" /s. Note the use of the * symbol to search more effectively. If you enter it incorrectly, you will receive a "no label" error message like the example below. Quantrimang's advice is to always use two symbols * at the beginning and end of the search keyword.

Open files using Command Prompt on Windows 10

Once you find the file, you can open it immediately using Command Prompt with the default software.

First, you need to change the path to the folder containing the file. You can do this by using the command cdfollowed by the path to the folder containing the file. The best way to avoid errors is to copy the folder path listed in the search results.

How to find and open files using Command Prompt

Enter the file name with the full extension inside quotation marks ".."and press Enter. The file will be opened in the default software. You can open additional files if they are in the same folder as the original file.

How to find and open files using Command Prompt

How to find and open files using Command Prompt

After finishing, if you need to open other files, you can use the command cd..with the path to move to the new folder.

Good luck and please refer to other great tips on Quantrimang:

Sign up and earn $1000 a day ⋙

Leave a Comment

How to fix “Well Need Your Current Windows Password” error on Windows 10/11

How to fix “Well Need Your Current Windows Password” error on Windows 10/11

Are you getting the “We'll need your current Windows password one last time” error? This annoying pop-up can prevent you from getting things done.

Quickly fix Unmountable Boot Volume error on Windows 10/11

Quickly fix Unmountable Boot Volume error on Windows 10/11

The Unmountable Boot Volume error occurs due to some installed software conflicting with the operating system or due to the computer suddenly shutting down,... In the article below, WebTech360 will guide you through some ways to fix this error.

How to Fix Clipboard History Error in Windows 11 Latest Update

How to Fix Clipboard History Error in Windows 11 Latest Update

If you use Clipboard History to store data for later use, there is a small chance that the data will remain empty no matter what you try.

How to remove Copilot and other AI features in Windows

How to remove Copilot and other AI features in Windows

If you don't care about having extra bloatware on your system, there are ways to remove or disable Windows Copilot on Windows 11.

Why is the laptop battery percentage estimate never accurate?

Why is the laptop battery percentage estimate never accurate?

Most laptop users have encountered a situation where Windows shows 2 hours of battery life left, then five minutes later it jumps to 5 hours or even 1 hour. Why does this time jump around like that?

10 Windows 11 settings to maximize laptop battery life

10 Windows 11 settings to maximize laptop battery life

Laptop batteries degrade over time and lose capacity, resulting in less battery life. But after tweaking some deeper Windows 11 settings, you should see a significant improvement in battery life.

Microsoft: PCs running Windows 11 21H2/22H2 will be forced to update to 23H2 next month

Microsoft: PCs running Windows 11 21H2/22H2 will be forced to update to 23H2 next month

Windows 11 version 21H2 is one of the major original releases of Windows 11 that began rolling out globally on October 4, 2021.

Microsoft spams Copilot QR codes on Windows 11 lock screen to lure users

Microsoft spams Copilot QR codes on Windows 11 lock screen to lure users

The year 2023 saw Microsoft betting heavily on artificial intelligence and its partnership with OpenAI to make Copilot a reality.

How to Disable User Accounts on Windows 11

How to Disable User Accounts on Windows 11

You can disable User Accounts so that others can no longer access your computer.

Buying a Windows laptop is harder than ever

Buying a Windows laptop is harder than ever

Is the NPU different enough to delay purchase and wait for the PC Copilot+ to become mainstream?

How to turn on and off battery saving mode on Windows 11 laptop

How to turn on and off battery saving mode on Windows 11 laptop

Windows 11's Battery saver mode is a feature designed to extend laptop battery life.

Microsoft Launches New Sticky Notes App for Windows 11

Microsoft Launches New Sticky Notes App for Windows 11

After keeping things the same for years, the Sticky Note update in mid-2024 changed the game.

How to fix IRQL NOT LESS OR EQUAL error on Windows

How to fix IRQL NOT LESS OR EQUAL error on Windows

The IRQL NOT LESS OR EQUAL error is a memory-related error that typically occurs when a system process or driver attempts to access a memory address without proper access permissions.

6 Ways to Copy File and Folder Paths in Windows 11

6 Ways to Copy File and Folder Paths in Windows 11

Paths are the locations of files or folders in Windows 11. All paths include the folders you need to open to get to a specific location.

Compare Windows 10 and Windows 11

Compare Windows 10 and Windows 11

Windows 11 has officially launched, compared to Windows 10 Windows 11 also has many changes, from the interface to new features. Please follow the details in the article below.