Windows console open file

How to Open a File/Folder in Command Prompt (CMD) Windows 10 [MiniTool News]

By Alisa | Follow | Last Updated December 31, 2020

Summary :

Wonder how to open a file cmd or how to open a folder in Command Prompt on Windows 10? This tutorial provides a step-by-step guide. Also, if you can’t find some files or folders in Windows 10, or some files are unexpectedly lost in your Windows 10 computer, MiniTool free data recovery software for Windows 10/8/7 can help you easily recover lost files.

You can also open files from Command Prompt. Wonder how to open a file or folder in Command Prompt on Windows 10? Check the step-by-step guide in this tutorial.

How to Open a File CMD Windows 10 in 2 Steps

Step 1 – Open Command Prompt

You can press Windows + R keys on the keyboard to open Windows Run dialog. Then type cmd in the Run box. If you want to run Command Prompt as Administrator, you need to press Ctrl + Shift + Enter keys at the same time.

Alternatively, you can also click Start or Search box in Windows 10, and type cmd or command prompt. Right-click the Command Prompt app in the list and choose Run as administrator.

Step 2 – Open Files from Command Prompt

Normally you have two ways to open a file using cmd. One is to move the folder that the file is in, the other is to open the files directly in Command Prompt.

Method 1. How to open a file with cmd by moving to the folder firstly

  • You can use the cd command to move to the exact folder the file lies in. For instance, cd C:\Users\mini\Desktop.
  • After you are in the correct folder path, you can type the name of the file with its extension, e.g. “travel.png”, and hit Enter button to open it.

Windows 10 repair, recovery, reboot, reinstall, restore solutions. Learn how to create Windows 10 repair disk, recovery disk/USB drive/system image to repair Windows 10 OS issues.

Method 2. How to open a file using cmd directly

You can also choose to open files from Command Prompt on Windows 10 directly, instead of going to the folder path. You can input the full path, file name and its file extension to open the target file, e.g. “C:\Users\mini\Desktop\travel.png”.

You can also freely specify an app to open the file. You need to type the whole path of the app ahead of the path of the file. For example, C:\Users\mini\”%windir%\system32\mspaint.exe” “C:\Users\mini\Desktop\travel.png”.

How to Open a Folder in Command Prompt Windows 10

You can also open a folder from Command Prompt with the command line below.

After you enter into Command Prompt window by following the operation above, you can open a folder in File Explorer in Command Prompt. The command line can be like this, start %windir%\explorer.exe “C:\Users\mini\Desktop”.

Tip: Need to mention that you need to enclose the path of a file or folder in double quotation marks, since some folder or files names have spaces in them.

To Recover Unexpectedly Lost Files or Folders in Windows 10

Sometimes you may suffer unexpected data loss in Windows 10 due to various reasons, e.g. system crash, Blue Screen error (e.g. Bad Pool Caller BSOD error), power outage, malware/virus infection, hard drive failure, etc. To easily recover lost data for free, you can choose the best free data recovery software to realize it.

Читайте также:  Топ антивирусов для mac os

MiniTool Power Data Recovery, a 100% clean and free data recovery software for Windows 10/8/7, enables you to easily recover mistakenly deleted files or lost files from computer local drive, external hard drive, SSD drive, USB drive (pen drive data recovery), SD card, and more.

Easy 3 steps to fast recover my files/data for free with best free file recovery software. 23 FAQs and solutions for how to recover my files and lost data are included.

  • Facebook
  • Twitter
  • Linkedin
  • Reddit

ABOUT THE AUTHOR

Position: Columnist

Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.

openfiles openfiles

Позволяет администратору запрашивать, отображать или отключать файлы и каталоги, открытые в системе. Enables an administrator to query, display, or disconnect files and directories that have been opened on a system. Эта команда также включает или отключает глобальный флаг System обслуживание списка объектов . This command also enables or disables the system Maintain Objects List global flag.

Openfiles/Disconnect openfiles /disconnect

Позволяет администратору отключить файлы и папки, открытые удаленно через общую папку. Enables an administrator to disconnect files and folders that have been opened remotely through a shared folder.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
ключ /s Указывает удаленную систему для подключения (по имени или IP-адресу). Specifies the remote system to connect to (by name or IP address). Не используйте обратные косые черты. Don’t use backslashes. Если параметр /s не используется, команда по умолчанию выполняется на локальном компьютере. If you don’t use the /s option, the command is run on the local computer by default. Этот параметр применяется ко всем файлам и папкам, указанным в команде. This parameter applies to all files and folders that are specified in the command.
/u [ \] /u [ \] Выполняет команду, используя разрешения указанной учетной записи пользователя. Runs the command using the permissions of the specified user account. Если параметр /u не используется, по умолчанию используются разрешения системы. If you don’t use the /u option, system permissions are used by default.
/p [

] Указывает пароль учетной записи пользователя, указанной в параметре /u . Specifies the password of the user account that is specified in the /u option. Если вы не используете параметр /p , при выполнении команды появится запрос на ввод пароля. If you don’t use the /p option, a password prompt appears when the command is run. /ID /id Отключает открытые файлы по указанному ИДЕНТИФИКАТОРу файла. Disconnects open files by the specified file ID. С этим параметром можно использовать подстановочный знак (*). You can use the wildcard character (*) with this parameter.

Примечание. для поиска идентификатора файла можно использовать команду openfiles/Query . Note: You can use the openfiles /query command to find the file ID. / /a

Отключает все открытые файлы, связанные с именем пользователя, указанным в параметре акцесседби . Disconnects all open files associated with the user name specified in the accessedby parameter. С этим параметром можно использовать подстановочный знак (*). You can use the wildcard character (*) with this parameter. /o /o Отключает все открытые файлы с указанным значением в открытом режиме. Disconnects all open files with the specified open mode value. Допустимые значения: Чтение, запись, чтение и запись. Valid values are Read, Write, or Read/Write. С этим параметром можно использовать подстановочный знак (*). You can use the wildcard character (*) with this parameter. /Op /op Отключает все соединения открытых файлов, созданные с помощью определенного имени открытого файла. Disconnects all open file connections that are created by a specific open file name. С этим параметром можно использовать подстановочный знак (*). You can use the wildcard character (*) with this parameter. /? /? Отображение справки в командной строке. Displays help at the command prompt.

Примеры Examples

Чтобы отключить все открытые файлы с помощью идентификатора файла 26843578, введите: To disconnect all open files with the file ID 26843578, type:

Чтобы отключить все открытые файлы и каталоги, к которым обращается пользователь хироплн, введите: To disconnect all open files and directories accessed by the user hiropln, type:

Чтобы отключить все открытые файлы и каталоги с режимом чтения и записи, введите: To disconnect all open files and directories with read/write mode, type:

Чтобы отключить каталог с открытым именем файла * К:\тестшаре * , независимо от того, кто обращается к нему, введите: To disconnect the directory with the open file name *C:\testshare*, regardless of who is accessing it, type:

Чтобы отключить все открытые файлы на удаленном компьютере срвмаин , к которым обращается пользовательская хироплн, независимо от их идентификатора, введите: To disconnect all open files on the remote computer srvmain that are being accessed by the user hiropln, regardless of their ID, type:

Openfiles/Query openfiles /query

Запрашивает и отображает все открытые файлы. Queries and displays all open files.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
ключ /s Указывает удаленную систему для подключения (по имени или IP-адресу). Specifies the remote system to connect to (by name or IP address). Не используйте обратные косые черты. Don’t use backslashes. Если параметр /s не используется, команда по умолчанию выполняется на локальном компьютере. If you don’t use the /s option, the command is run on the local computer by default. Этот параметр применяется ко всем файлам и папкам, указанным в команде. This parameter applies to all files and folders that are specified in the command.
/u [ \] /u [ \] Выполняет команду, используя разрешения указанной учетной записи пользователя. Runs the command using the permissions of the specified user account. Если параметр /u не используется, по умолчанию используются разрешения системы. If you don’t use the /u option, system permissions are used by default.
/p [

] Указывает пароль учетной записи пользователя, указанной в параметре /u . Specifies the password of the user account that is specified in the /u option. Если вы не используете параметр /p , при выполнении команды появится запрос на ввод пароля. If you don’t use the /p option, a password prompt appears when the command is run. [/FO

] [/fo
]
Отображает выходные данные в указанном формате. Displays the output in the specified format. Допустимые значения: Valid values include:

  • Таблица — отображает выходные данные в таблице. TABLE — Displays output in a table.
  • List — отображает выходные данные в списке. LIST — Displays output in a list.
  • CSV — отображает выходные данные в формате с разделителями-запятыми (CSV). CSV — Displays output in Comma Separated Values (CSV) format.
использован /nh Подавляет вывод заголовков столбцов в выходных данных. Suppresses column headers in the output. Допустим, только если параметр /FO имеет значение Table или CSV. Valid only when the /fo parameter is set to TABLE or CSV.
/v /v Указывает, что в выходных данных отображаются подробные (подробные) сведения. Specifies that detailed (verbose) information be displayed in the output.
/? /? Отображение справки в командной строке. Displays help at the command prompt.

Примеры Examples

Чтобы запросить и отобразить все открытые файлы, введите: To query and display all open files, type:

Чтобы запросить и отобразить все открытые файлы в формате таблицы без заголовков, введите: To query and display all open files in table format without headers, type:

Чтобы запросить и отобразить все открытые файлы в формате списка с подробными сведениями, введите: To query and display all open files in list format with detailed information, type:

Чтобы запросить и отобразить все открытые файлы в удаленной системе срвмаин , используя учетные данные пользователя хироплн в домене маиндом , введите: To query and display all open files on the remote system srvmain by using the credentials for the user hiropln on the maindom domain, type:

В этом примере пароль указан в командной строке. In this example, the password is supplied on the command line. Чтобы запретить отображение пароля, оставьте параметр /p . To prevent displaying the password, leave out the /p option. Вам будет предложено ввести пароль, который не будет отображаться на экране. You’ll be prompted for the password, which won’t be echoed to the screen.

Openfiles/Local openfiles /local

Включает или отключает глобальный флаг System обслуживании списка объектов . Enables or disables the system Maintain Objects List global flag. Если используется без параметров, то openfiles/Local отображает текущее состояние флага » сохранить глобальный список объектов «. If used without parameters, openfiles /local displays the current status of the Maintain Objects List global flag.

Изменения, внесенные с помощью параметра вкл . или выкл ., вступают в силу только после перезагрузки системы. Changes made by using the on or off option don’t take effect until you restart the system. Включение глобального флага » Ведение списка объектов » может замедлить работу системы. Enabling the Maintain Objects List global flag might slow down your system.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
[on | off] Включает или отключает глобальный флаг System обслуживание списка объектов , который отслеживает дескрипторы локальных файлов. Enables or disables the system Maintain Objects List global flag, which tracks local file handles.
/? /? Отображение справки в командной строке. Displays help at the command prompt.

Примеры Examples

Чтобы проверить текущее состояние глобального флага » сохранить список объектов «, введите: To check the current status of the Maintain Objects List global flag, type:

По умолчанию глобальный флаг « Ведение списка объектов » отключен, и появляется следующее сообщение: INFO: The system global flag ‘maintain objects list’ is currently disabled. By default, the Maintain Objects List global flag is disabled, and the following message appears, INFO: The system global flag ‘maintain objects list’ is currently disabled.

Чтобы включить глобальный флаг » Ведение списка объектов «, введите: To enable the Maintain Objects List global flag, type:

При включении глобального флага появляется следующее сообщение: SUCCESS: The system global flag ‘maintain objects list’ is enabled. This will take effect after the system is restarted. The following message appears when the global flag is enabled, SUCCESS: The system global flag ‘maintain objects list’ is enabled. This will take effect after the system is restarted.

Чтобы отключить глобальный флаг » Ведение списка объектов «, введите: To disable the Maintain Objects List global flag, type:

Читайте также:  Текстовая операционная оболочка для windows
Оцените статью